spec/dummy/log/test.log in bookingsync-engine-3.0.1 vs spec/dummy/log/test.log in bookingsync-engine-3.0.2

- old
+ new

@@ -1,6972 +1,712 @@ -  (0.4ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 10ms (Views: 10.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.630977"], ["updated_at", "2015-10-28 14:55:56.630977"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 51ms (ActiveRecord: 2.6ms) -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.640757"], ["updated_at", "2015-10-28 14:55:56.640757"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.6ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.648162"], ["updated_at", "2015-10-28 14:55:56.648162"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.6ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.0ms) rollback transaction -  (0.1ms) begin transaction +  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.0ms) begin transaction -  (0.0ms) rollback transaction -  (0.0ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-10-28 14:55:56.687548"], ["updated_at", "2015-10-28 14:55:56.687548"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 - SQL (1.6ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-10-28 14:55:56.690615"], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-10-28 14:55:56.703275"], ["updated_at", "2015-10-28 14:55:56.703275"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.4ms) rollback transaction -  (0.3ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.730513"], ["updated_at", "2015-10-28 14:55:56.730513"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:55:56.733493"], ["updated_at", "2015-10-28 14:55:56.733493"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:55:56.736712"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.741554"], ["updated_at", "2015-10-28 14:55:56.741554"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:55:56.745431"], ["updated_at", "2015-10-28 14:55:56.745431"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:55:56.749020"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.755346"], ["updated_at", "2015-10-28 14:55:56.755346"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:55:56.758101"], ["updated_at", "2015-10-28 14:55:56.758101"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:55:56.761269"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.766035"], ["updated_at", "2015-10-28 14:55:56.766035"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.773556"], ["updated_at", "2015-10-28 14:55:56.773556"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.778572"], ["updated_at", "2015-10-28 14:55:56.778572"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.781730"], ["updated_at", "2015-10-28 14:55:56.781730"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.786643"], ["updated_at", "2015-10-28 14:55:56.786643"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.789526"], ["updated_at", "2015-10-28 14:55:56.789526"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.793733"], ["updated_at", "2015-10-28 14:55:56.793733"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.796367"], ["updated_at", "2015-10-28 14:55:56.796367"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1446130556"], ["created_at", "2015-10-28 14:55:56.802585"], ["updated_at", "2015-10-28 14:55:56.802585"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957756"], ["created_at", "2015-10-28 14:55:56.806984"], ["updated_at", "2015-10-28 14:55:56.806984"]] -  (1.0ms) commit transaction -  (0.3ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446216956"], ["updated_at", "2015-10-28 14:55:56.812946"], ["id", 1]] -  (0.8ms) commit transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.8ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957756"], ["created_at", "2015-10-28 14:55:56.819852"], ["updated_at", "2015-10-28 14:55:56.819852"]] -  (0.9ms) commit transaction -  (0.1ms) begin transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446216956"], ["updated_at", "2015-10-28 14:55:56.825186"], ["id", 2]] -  (0.8ms) commit transaction -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) begin transaction - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.8ms) commit transaction -  (0.3ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.0ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) -Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) -Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.624521"], ["updated_at", "2015-10-28 14:57:46.624521"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 46ms (ActiveRecord: 2.1ms) -  (1.9ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.633729"], ["updated_at", "2015-10-28 14:57:46.633729"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 4ms (ActiveRecord: 0.6ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.641101"], ["updated_at", "2015-10-28 14:57:46.641101"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.6ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction +  (0.3ms) ROLLBACK +  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= + Rendering html template + Rendered html template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction +Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms) +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.664531"], ["updated_at", "2015-10-28 14:57:46.664531"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (1.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.672302"], ["updated_at", "2015-10-28 14:57:46.672302"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.679017"], ["updated_at", "2015-10-28 14:57:46.679017"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.693056"], ["updated_at", "2015-10-28 14:57:46.693056"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.697565"], ["updated_at", "2015-10-28 14:57:46.697565"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.700146"], ["updated_at", "2015-10-28 14:57:46.700146"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.704766"], ["updated_at", "2015-10-28 14:57:46.704766"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.708263"], ["updated_at", "2015-10-28 14:57:46.708263"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.713202"], ["updated_at", "2015-10-28 14:57:46.713202"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:57:46.715195"], ["updated_at", "2015-10-28 14:57:46.715195"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:57:46.719187"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.726007"], ["updated_at", "2015-10-28 14:57:46.726007"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:57:46.727914"], ["updated_at", "2015-10-28 14:57:46.727914"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:57:46.730429"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.734981"], ["updated_at", "2015-10-28 14:57:46.734981"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:57:46.736981"], ["updated_at", "2015-10-28 14:57:46.736981"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:57:46.739829"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (1.0ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-10-28 14:57:46.752725"], ["updated_at", "2015-10-28 14:57:46.752725"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957866"], ["created_at", "2015-10-28 14:57:46.770624"], ["updated_at", "2015-10-28 14:57:46.770624"]] -  (1.1ms) commit transaction -  (0.3ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446217066"], ["updated_at", "2015-10-28 14:57:46.778538"], ["id", 1]] -  (0.9ms) commit transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) begin transaction - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.8ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957866"], ["created_at", "2015-10-28 14:57:46.785176"], ["updated_at", "2015-10-28 14:57:46.785176"]] -  (0.9ms) commit transaction -  (0.0ms) begin transaction -  (0.1ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446217066"], ["updated_at", "2015-10-28 14:57:46.789700"], ["id", 2]] -  (0.7ms) commit transaction -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) begin transaction - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.9ms) commit transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1446130666"], ["created_at", "2015-10-28 14:57:46.797375"], ["updated_at", "2015-10-28 14:57:46.797375"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-10-28 14:57:46.810451"], ["updated_at", "2015-10-28 14:57:46.810451"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 - SQL (0.6ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-10-28 14:57:46.813570"], ["id", 3]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]] -  (0.7ms) rollback transaction -  (0.3ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2016-08-22 14:36:50.661939"], ["updated_at", "2016-08-22 14:36:50.661939"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 - SQL (0.8ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 14:36:50.666433"], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.683667"], ["updated_at", "2016-08-22 14:36:50.683667"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 14:36:50.685618"], ["updated_at", "2016-08-22 14:36:50.685618"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 14:36:50.688897"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (1.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.699771"], ["updated_at", "2016-08-22 14:36:50.699771"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 14:36:50.703880"], ["updated_at", "2016-08-22 14:36:50.703880"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 14:36:50.706853"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.712557"], ["updated_at", "2016-08-22 14:36:50.712557"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 14:36:50.714995"], ["updated_at", "2016-08-22 14:36:50.714995"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 14:36:50.719861"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (1.2ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.727397"], ["updated_at", "2016-08-22 14:36:50.727397"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.733995"], ["updated_at", "2016-08-22 14:36:50.733995"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.739081"], ["updated_at", "2016-08-22 14:36:50.739081"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.743166"], ["updated_at", "2016-08-22 14:36:50.743166"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.749417"], ["updated_at", "2016-08-22 14:36:50.749417"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.752619"], ["updated_at", "2016-08-22 14:36:50.752619"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.760088"], ["updated_at", "2016-08-22 14:36:50.760088"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.766622"], ["updated_at", "2016-08-22 14:36:50.766622"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471790210"], ["created_at", "2016-08-22 14:36:50.774447"], ["updated_at", "2016-08-22 14:36:50.774447"]] -  (1.3ms) commit transaction -  (0.1ms) begin transaction -  (0.3ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472049410"], ["updated_at", "2016-08-22 14:36:50.800885"], ["id", 1]] -  (0.9ms) commit transaction -  (0.1ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (1.0ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471790210"], ["created_at", "2016-08-22 14:36:50.809857"], ["updated_at", "2016-08-22 14:36:50.809857"]] -  (1.1ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472049410"], ["updated_at", "2016-08-22 14:36:50.815715"], ["id", 2]] -  (0.9ms) commit transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.8ms) commit transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471963010"], ["created_at", "2016-08-22 14:36:50.822266"], ["updated_at", "2016-08-22 14:36:50.822266"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.9ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2016-08-22 14:36:50.841678"], ["updated_at", "2016-08-22 14:36:50.841678"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.8ms) -Completed 200 OK in 19ms (Views: 19.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.918712"], ["updated_at", "2016-08-22 14:36:50.918712"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.8ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.928620"], ["updated_at", "2016-08-22 14:36:50.928620"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 7ms (ActiveRecord: 1.0ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 14:36:50.936808"], ["updated_at", "2016-08-22 14:36:50.936808"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.5ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.0ms) begin transaction -  (0.0ms) rollback transaction -  (0.5ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 11ms (Views: 10.4ms | ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.4ms) begin transaction -Processing by AuthenticatedController#index as HTML -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.336100"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.336100"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 37ms (ActiveRecord: 2.5ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.344106"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.344106"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 3ms (ActiveRecord: 0.6ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.350812"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.350812"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 4ms (ActiveRecord: 0.6ms) -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML -Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML -Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.2ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2016-08-22 17:45:37.392037"], ["synced_id", 0], ["updated_at", "2016-08-22 17:45:37.392037"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.406414"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2016-08-22 17:45:37.406414"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 - SQL (0.5ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2016-08-22 17:45:37.411970"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.418847"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.418847"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.420912"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.420912"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 17:45:37.425841"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.430533"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.430533"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.432343"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.432343"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 17:45:37.435103"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (1.4ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.440067"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.440067"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.442228"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.442228"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 17:45:37.445784"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (1.4ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.452172"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.452172"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.464514"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.464514"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (1.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.472142"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.472142"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.477417"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.477417"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.484772"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.484772"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (1.0ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.488036"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.488036"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.3ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.496422"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.496422"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (1.6ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.503037"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.503037"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.515613"], ["oauth_access_token", "token"], ["oauth_expires_at", "1471801537"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.515613"]] -  (2.1ms) commit transaction -  (0.4ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.5ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472060737"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 17:45:37.526148"]] -  (1.1ms) commit transaction - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.8ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.536018"], ["oauth_access_token", "token"], ["oauth_expires_at", "1471801537"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.536018"]] -  (1.0ms) commit transaction -  (0.2ms) begin transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472060737"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 17:45:37.541077"]] -  (0.8ms) commit transaction -  (0.1ms) rollback transaction - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.9ms) commit transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2016-08-22 17:45:37.549790"], ["oauth_access_token", "token"], ["oauth_expires_at", 1471974337], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.549790"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.2ms) begin transaction -  (0.2ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.6ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendered text template (0.1ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 17ms (Views: 16.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) -Completed 200 OK in 10ms (Views: 9.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.027308"], ["updated_at", "2016-08-22 17:45:46.027308"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 34ms (ActiveRecord: 2.5ms) -  (1.7ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.039346"], ["updated_at", "2016-08-22 17:45:46.039346"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 5ms (ActiveRecord: 0.6ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.052511"], ["updated_at", "2016-08-22 17:45:46.052511"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.7ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2016-08-22 17:45:46.058489"], ["updated_at", "2016-08-22 17:45:46.058489"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 - SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 17:45:46.062200"], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.072508"], ["updated_at", "2016-08-22 17:45:46.072508"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.9ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.080157"], ["updated_at", "2016-08-22 17:45:46.080157"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.087679"], ["updated_at", "2016-08-22 17:45:46.087679"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.092132"], ["updated_at", "2016-08-22 17:45:46.092132"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.097436"], ["updated_at", "2016-08-22 17:45:46.097436"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.100561"], ["updated_at", "2016-08-22 17:45:46.100561"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.106001"], ["updated_at", "2016-08-22 17:45:46.106001"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 17:45:46.109108"], ["updated_at", "2016-08-22 17:45:46.109108"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.114105"], ["updated_at", "2016-08-22 17:45:46.114105"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 17:45:46.118195"], ["updated_at", "2016-08-22 17:45:46.118195"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 17:45:46.121965"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.126284"], ["updated_at", "2016-08-22 17:45:46.126284"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 17:45:46.128610"], ["updated_at", "2016-08-22 17:45:46.128610"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 17:45:46.133576"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.138118"], ["updated_at", "2016-08-22 17:45:46.138118"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 17:45:46.140245"], ["updated_at", "2016-08-22 17:45:46.140245"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 17:45:46.143528"], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (0.8ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974346"], ["created_at", "2016-08-22 17:45:46.150280"], ["updated_at", "2016-08-22 17:45:46.150280"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801546"], ["created_at", "2016-08-22 17:45:46.158650"], ["updated_at", "2016-08-22 17:45:46.158650"]] -  (1.1ms) commit transaction -  (0.1ms) begin transaction -  (0.6ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472060746"], ["updated_at", "2016-08-22 17:45:46.170011"], ["id", 1]] -  (0.9ms) commit transaction -  (0.1ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.9ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801546"], ["created_at", "2016-08-22 17:45:46.178203"], ["updated_at", "2016-08-22 17:45:46.178203"]] -  (1.0ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472060746"], ["updated_at", "2016-08-22 17:45:46.185666"], ["id", 2]] -  (0.9ms) commit transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.8ms) commit transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2016-08-22 17:45:46.206240"], ["updated_at", "2016-08-22 17:45:46.206240"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.3ms) begin transaction -Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction +Completed 401 Unauthorized in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms) +  (0.4ms) ROLLBACK +  (0.4ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -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 11ms (ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.3ms) rollback transaction -  (0.2ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 17ms (Views: 10.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.5ms) ROLLBACK +  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 68ms (ActiveRecord: 3.9ms) -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.9ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.6ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974355"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801555"]] + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:27:11.332114"], ["updated_at", "2017-11-29 18:27:11.332114"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.5ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:45:55 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472060755"], ["id", 1]] -  (0.1ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801555"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:45:55 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472060755"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.8ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:45:55 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:45:55 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:45:55 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:45:55 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.7ms) rollback transaction -  (0.3ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 4ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.6ms) -Completed 200 OK in 24ms (Views: 15.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (1.5ms) begin transaction +Completed 302 Found in 31ms (ActiveRecord: 9.8ms) +  (0.3ms) ROLLBACK +  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 57ms (ActiveRecord: 4.3ms) -  (1.8ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:27:11.342888"], ["updated_at", "2017-11-29 18:27:11.342888"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.9ms) -  (0.4ms) rollback transaction -  (0.1ms) begin transaction +Completed 302 Found in 6ms (ActiveRecord: 3.0ms) +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 1.0ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:48:55 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (1.4ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:48:55 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:48:55 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (1.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:48:55 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801735"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.6ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:48:55 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472060935"], ["id", 1]] -  (0.1ms) rollback transaction -  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801735"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:48:55 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472060935"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.3ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974535"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.8ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:51:14 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:51:14 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:51:14 UTC], ["id", 2]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:51:14 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974674"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) rollback transaction -  (0.2ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801874"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:51:14 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061074"], ["id", 1]] -  (0.0ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471801874"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:51:14 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061074"], ["id", 1]] -  (0.0ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) -Completed 200 OK in 20ms (Views: 15.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.8ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.7ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 4ms (ActiveRecord: 0.7ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 8ms (Views: 7.7ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.0ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.3ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:53:49 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:53:49 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:53:49 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:53:49 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974829"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802029"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:53:49 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061229"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802029"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:53:49 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061229"], ["id", 1]] -  (0.1ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ? [["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:53:49 UTC], ["synced_id", 0], ["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 0], ["LIMIT", 1]] -  (1.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.3ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 4ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 12ms (Views: 7.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) -Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.9ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 5ms (ActiveRecord: 0.9ms) -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.9ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.2ms) rollback transaction -  (0.5ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (1.0ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.9ms) commit transaction - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:54:50 UTC], ["id", 2]] -  (1.1ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) rollback transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ? [["LIMIT", 1]] - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (1.0ms) commit transaction -  (0.1ms) begin transaction - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.8ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802090"]] -  (1.2ms) commit transaction -  (0.3ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 3], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:54:50 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061290"], ["id", 3]] -  (0.8ms) commit transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]] -  (0.9ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974890"]] -  (1.0ms) commit transaction -  (0.2ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (1.2ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 5], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:54:50 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 5]] -  (0.9ms) commit transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 5], ["LIMIT", 1]] -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 12ms (Views: 10.1ms | ActiveRecord: 0.0ms) -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 0.7ms | ActiveRecord: 0.0ms) -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 7ms (ActiveRecord: 0.0ms) -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.7ms) -Completed 200 OK in 26ms (Views: 14.5ms | ActiveRecord: 0.0ms) -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) -Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) rollback transaction -Completed 422 Unprocessable Entity in 8ms (ActiveRecord: 0.8ms) -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) rollback transaction -Completed 422 Unprocessable Entity in 6ms (ActiveRecord: 0.7ms) -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) rollback transaction -Completed 422 Unprocessable Entity in 5ms (ActiveRecord: 0.6ms) -  (0.3ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.0ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 6ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 25ms (Views: 15.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 50ms (ActiveRecord: 3.4ms) -  (2.5ms) rollback transaction -  (0.3ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.8ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.8ms) -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:56:08 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:56:08 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:56:08 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (1.2ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 17:56:08 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ? [["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:56:08 UTC], ["synced_id", 0], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 0], ["LIMIT", 1]] -  (1.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471974968"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802168"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 -  (0.3ms) begin transaction - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:56:08 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061368"], ["id", 1]] -  (0.1ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802168"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 17:56:08 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061368"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.4ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.4ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) -Completed 200 OK in 42ms (Views: 42.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) -Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.412868"], ["updated_at", "2016-08-22 18:00:42.412868"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 56ms (ActiveRecord: 3.4ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (1.0ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.426461"], ["updated_at", "2016-08-22 18:00:42.426461"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 1.4ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.441174"], ["updated_at", "2016-08-22 18:00:42.441174"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.7ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 2ms (ActiveRecord: 0.0ms) -  (0.3ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-08-22 18:00:42.473711"], ["updated_at", "2016-08-22 18:00:42.473711"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) UPDATE "accounts" SET "synced_id" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["synced_id", 0], ["updated_at", "2016-08-22 18:00:42.475788"], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.497065"], ["updated_at", "2016-08-22 18:00:42.497065"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.505145"], ["updated_at", "2016-08-22 18:00:42.505145"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (1.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.511236"], ["updated_at", "2016-08-22 18:00:42.511236"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.518187"], ["updated_at", "2016-08-22 18:00:42.518187"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.523557"], ["updated_at", "2016-08-22 18:00:42.523557"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.528681"], ["updated_at", "2016-08-22 18:00:42.528681"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.535412"], ["updated_at", "2016-08-22 18:00:42.535412"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:00:42.538943"], ["updated_at", "2016-08-22 18:00:42.538943"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.544616"], ["updated_at", "2016-08-22 18:00:42.544616"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:00:42.548093"], ["updated_at", "2016-08-22 18:00:42.548093"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 18:00:42.556467"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.1ms) rollback transaction -  (0.2ms) begin transaction -  (0.9ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.572923"], ["updated_at", "2016-08-22 18:00:42.572923"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:00:42.576656"], ["updated_at", "2016-08-22 18:00:42.576656"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 18:00:42.581876"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.591245"], ["updated_at", "2016-08-22 18:00:42.591245"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:00:42.595914"], ["updated_at", "2016-08-22 18:00:42.595914"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (19.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 18:00:42.651142"], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (8.6ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471975242"], ["created_at", "2016-08-22 18:00:42.663116"], ["updated_at", "2016-08-22 18:00:42.663116"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (2.5ms) rollback transaction -  (0.3ms) begin transaction - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802442"], ["created_at", "2016-08-22 18:00:42.691381"], ["updated_at", "2016-08-22 18:00:42.691381"]] -  (1.3ms) commit transaction -  (0.5ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.6ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061642"], ["updated_at", "2016-08-22 18:00:42.703750"], ["id", 1]] -  (1.0ms) commit transaction - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (1.1ms) commit transaction -  (0.1ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802442"], ["created_at", "2016-08-22 18:00:42.715799"], ["updated_at", "2016-08-22 18:00:42.715799"]] -  (1.0ms) commit transaction -  (0.1ms) begin transaction -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.6ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061642"], ["updated_at", "2016-08-22 18:00:42.723418"], ["id", 2]] -  (1.1ms) commit transaction -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) begin transaction - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]] -  (0.9ms) commit transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2016-08-22 18:00:42.734407"], ["updated_at", "2016-08-22 18:00:42.734407"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 - SQL (0.5ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 18:00:42.739500"], ["id", 3]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]] -  (1.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendered text template (0.1ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.4ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 10ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) -Completed 200 OK in 22ms (Views: 15.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 66ms (ActiveRecord: 3.5ms) -  (2.8ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 19ms (ActiveRecord: 1.7ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 8ms (ActiveRecord: 1.3ms) -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.2ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 1.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:00:56 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (1.0ms) rollback transaction -  (0.3ms) begin transaction - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ? [["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (1.7ms) UPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:00:56 UTC], ["synced_id", 0], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 0], ["LIMIT", 1]] -  (1.2ms) rollback transaction -  (0.1ms) begin transaction -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802456"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.3ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:00:56 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061656"], ["id", 1]] -  (0.0ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802456"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:00:56 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061656"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471975256"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:00:56 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:00:56 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.2ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:00:56 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.7ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.3ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (1.8ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.6ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -  (0.3ms) rollback transaction -  (3.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (2.0ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (1.1ms) rollback transaction -  (0.4ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (1.9ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:02:13 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:02:13 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (1.4ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:02:13 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471975333"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802533"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) begin transaction - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:13 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061733"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802533"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:13 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061733"], ["id", 1]] -  (0.0ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ? [["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (1.4ms) UPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:13 UTC], ["synced_id", 0], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 0], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.3ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:27:11.349999"], ["updated_at", "2017-11-29 18:27:11.349999"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:13 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (1.8ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 9ms (Views: 7.9ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 8ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin -Completed 302 Found in 8ms (ActiveRecord: 0.9ms) -  (0.6ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 0.8ms) -  (0.5ms) rollback transaction -  (0.2ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 7ms (ActiveRecord: 1.0ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) -Completed 200 OK in 23ms (Views: 16.6ms | ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction +Completed 302 Found in 4ms (ActiveRecord: 1.9ms) +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction +  (0.5ms) ROLLBACK +  (0.4ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.5ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -  (0.0ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 4ms (ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 3ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 19ms (Views: 14.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 56ms (ActiveRecord: 3.4ms) -  (1.7ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.6ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 8ms (ActiveRecord: 1.8ms) -  (0.5ms) rollback transaction -  (0.1ms) begin transaction -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 11ms (ActiveRecord: 1.4ms) -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ? [["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ? [["id", 1], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:47 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] -  (1.1ms) rollback transaction -  (0.4ms) begin transaction -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:02:47 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:02:47 UTC], ["id", 2]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:02:47 UTC], ["id", 2]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SELECT COUNT(*) FROM "accounts" -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.2ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["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 transaction -  (0.1ms) begin transaction -  (0.0ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ? [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802567"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.5ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:47 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061767"], ["id", 1]] -  (0.0ms) rollback transaction -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.8ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471802567"]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) begin transaction - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ? [["synced_id", 123], ["id", 1], ["LIMIT", 1]] - SQL (0.2ms) UPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:47 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472061767"], ["id", 1]] -  (0.1ms) rollback transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.0ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]] -  (0.0ms) RELEASE SAVEPOINT active_record_1 -  (0.9ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471975367"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.7ms) rollback transaction -  (0.1ms) begin transaction -  (0.1ms) rollback transaction -  (0.2ms) begin transaction - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ? [["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?) [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ? [["updated_at", 2016-08-22 18:02:47 UTC], ["synced_id", 0], ["id", 1]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ? [["synced_id", 0], ["LIMIT", 1]] -  (0.8ms) rollback transaction -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.8ms) SAVEPOINT active_record_1 - Account Exists (19.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:11 UTC], ["updated_at", 2016-08-22 18:16:11 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.7ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 220ms (ActiveRecord: 67.1ms) -  (0.8ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:11 UTC], ["updated_at", 2016-08-22 18:16:11 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 10ms (ActiveRecord: 1.9ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:11 UTC], ["updated_at", 2016-08-22 18:16:11 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.6ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 15ms (ActiveRecord: 2.1ms) -  (0.7ms) ROLLBACK -  (0.6ms) BEGIN -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) -Completed 200 OK in 39ms (Views: 26.5ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK -  (0.1ms) BEGIN +  (0.3ms) BEGIN Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 2ms (ActiveRecord: 0.0ms) + Rendering /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.6ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 10ms (Views: 6.7ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK +  (0.5ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) +Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) +  (0.5ms) ROLLBACK +  (0.4ms) BEGIN +  (0.4ms) ROLLBACK +  (0.4ms) BEGIN +  (0.4ms) ROLLBACK +  (0.4ms) BEGIN +  (0.4ms) ROLLBACK +  (0.4ms) BEGIN +  (0.5ms) ROLLBACK  (0.3ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 4ms (ActiveRecord: 0.0ms) -  (0.7ms) ROLLBACK +  (1.2ms) ROLLBACK  (0.3ms) BEGIN -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.4ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 61ms (Views: 59.1ms | ActiveRecord: 0.0ms) -  (0.3ms) ROLLBACK -  (0.2ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.1ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 6ms (Views: 4.9ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) -  (0.3ms) ROLLBACK -  (0.3ms) BEGIN -  (0.5ms) ROLLBACK -  (0.2ms) BEGIN -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (4.9ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.6ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (7.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 5], ["LIMIT", 1]] - SQL (12.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:16:12 UTC], ["id", 5]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-11-29 18:27:11.405881"], ["updated_at", "2017-11-29 18:27:11.405881"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 7], ["LIMIT", 1]] - SQL (0.9ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:16:12 UTC], ["id", 7]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 7], ["LIMIT", 1]] -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 9], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:16:12 UTC], ["id", 9]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 9], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.5ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.4ms) SAVEPOINT active_record_1 - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (2.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.0ms) SAVEPOINT active_record_1 + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-11-29 18:27:11.409456"], ["synced_id", 0], ["id", 4]]  (0.4ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["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.3ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.5ms) ROLLBACK +  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 - SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 18:16:12 UTC], ["synced_id", 0], ["id", 18]] + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-11-29 18:27:11.425851"], ["updated_at", "2017-11-29 18:27:11.425851"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 19], ["LIMIT", 1]] - SQL (1.1ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:16:12 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 19]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.4ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471803372"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.2ms) BEGIN - Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:16:12 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472062572"], ["id", 20]] -  (0.2ms) COMMIT -  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]] - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" -  (5.8ms) SAVEPOINT active_record_1 - SQL (7.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) SAVEPOINT active_record_1 + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 5], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:27:11.430912"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 5]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 5], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 - Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471803372"]] + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.438693"], ["updated_at", "2017-11-29 18:27:11.438693"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 21], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:16:12 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472062572"], ["id", 21]] -  (0.2ms) COMMIT - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]] -  (0.7ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 +  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471976172"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.4ms) ROLLBACK -  (0.3ms) BEGIN -  (1.8ms) ROLLBACK -  (0.3ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.7ms) BEGIN -  (0.6ms) ROLLBACK -  (0.5ms) BEGIN -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (2.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471803872"], ["created_at", "2016-08-22 18:24:32.438572"], ["updated_at", "2016-08-22 18:24:32.438572"]] -  (2.3ms) COMMIT -  (0.2ms) BEGIN - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 - SQL (0.5ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063072"], ["updated_at", "2016-08-22 18:24:32.486945"], ["id", 1]] -  (0.4ms) COMMIT - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" -  (0.3ms) BEGIN - SQL (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1]] -  (0.4ms) COMMIT -  (0.2ms) BEGIN - Account Exists (2.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (1.1ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471803872"], ["created_at", "2016-08-22 18:24:32.513087"], ["updated_at", "2016-08-22 18:24:32.513087"]] -  (0.8ms) COMMIT -  (0.2ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063072"], ["updated_at", "2016-08-22 18:24:32.521329"], ["id", 2]] -  (0.3ms) COMMIT -  (0.2ms) ROLLBACK - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]] - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471976672"], ["created_at", "2016-08-22 18:24:32.534748"], ["updated_at", "2016-08-22 18:24:32.534748"]] -  (0.4ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.5ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (1.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-08-22 18:24:32.558967"], ["updated_at", "2016-08-22 18:24:32.558967"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.8ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2016-08-22 18:24:32.561894"], ["id", 4]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (1.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2016-08-22 18:24:32.580727"], ["updated_at", "2016-08-22 18:24:32.580727"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 18:24:32.584375"], ["id", 5]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.590050"], ["updated_at", "2016-08-22 18:24:32.590050"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) SELECT COUNT(*) FROM "accounts" - Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.4ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.602087"], ["updated_at", "2016-08-22 18:24:32.602087"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SELECT COUNT(*) FROM "accounts" -  (0.3ms) ROLLBACK -  (1.0ms) BEGIN -  (0.5ms) SAVEPOINT active_record_1 - Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.8ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.614370"], ["updated_at", "2016-08-22 18:24:32.614370"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.620885"], ["updated_at", "2016-08-22 18:24:32.620885"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.625970"], ["updated_at", "2016-08-22 18:24:32.625970"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.631796"], ["updated_at", "2016-08-22 18:24:32.631796"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.637146"], ["updated_at", "2016-08-22 18:24:32.637146"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.5ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.645615"], ["updated_at", "2016-08-22 18:24:32.645615"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.652084"], ["updated_at", "2016-08-22 18:24:32.652084"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:24:32.654523"], ["updated_at", "2016-08-22 18:24:32.654523"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 15) LIMIT 1 - SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 18:24:32.658910"], ["id", 15]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.666121"], ["updated_at", "2016-08-22 18:24:32.666121"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:24:32.669796"], ["updated_at", "2016-08-22 18:24:32.669796"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 17) LIMIT 1 - SQL (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 18:24:32.676803"], ["id", 17]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.686359"], ["updated_at", "2016-08-22 18:24:32.686359"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:24:32.689195"], ["updated_at", "2016-08-22 18:24:32.689195"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 19) LIMIT 1 - SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 18:24:32.694499"], ["id", 19]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] -  (0.6ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 21ms (Views: 20.0ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) -Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.6ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.764320"], ["updated_at", "2016-08-22 18:24:32.764320"]] -  (0.4ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 10ms (ActiveRecord: 2.4ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.781729"], ["updated_at", "2016-08-22 18:24:32.781729"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 1.2ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 18:24:32.793799"], ["updated_at", "2016-08-22 18:24:32.793799"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 6ms (ActiveRecord: 1.6ms) -  (0.2ms) ROLLBACK -  (0.3ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.3ms) ROLLBACK -  (1.7ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) -  (0.4ms) ROLLBACK -  (1.2ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.3ms) BEGIN - Account Exists (7.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.7ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804545"], ["created_at", "2016-08-22 18:35:45.810846"], ["updated_at", "2016-08-22 18:35:45.810846"]] -  (12.6ms) COMMIT -  (0.2ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 23) LIMIT 1 - SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063745"], ["updated_at", "2016-08-22 18:35:45.881232"], ["id", 23]] -  (6.3ms) COMMIT -  (0.2ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 23]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 23]] -  (5.6ms) COMMIT -  (0.1ms) BEGIN + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.441478"], ["updated_at", "2017-11-29 18:27:11.441478"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 - Account Exists (6.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (6.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:36:13 UTC], ["updated_at", 2016-08-22 18:36:13 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804573"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 24], ["LIMIT", 1]] - SQL (2.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:36:13 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063773"], ["id", 24]] -  (0.2ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 24], ["LIMIT", 1]] - Account Load (6.7ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 24]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:36:44 UTC], ["updated_at", 2016-08-22 18:36:44 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804604"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - 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", 25], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:36:44 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063804"], ["id", 25]] -  (0.1ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 25], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 25]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:37:53 UTC], ["updated_at", 2016-08-22 18:37:53 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804673"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - 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", 26], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:37:53 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063873"], ["id", 26]] -  (0.2ms) COMMIT -  (0.9ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 26], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 26]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:38:50 UTC], ["updated_at", 2016-08-22 18:38:50 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804729"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.2ms) BEGIN - 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", 27], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:38:50 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063930"], ["id", 27]] -  (0.2ms) COMMIT -  (0.5ms) SELECT COUNT(*) FROM "accounts" - Account Load (2.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 27], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 27]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:39:22 UTC], ["updated_at", 2016-08-22 18:39:22 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804762"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.3ms) BEGIN - Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 28], ["LIMIT", 1]] - SQL (2.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:39:22 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472063962"], ["id", 28]] -  (0.7ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 28], ["LIMIT", 1]] -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 28]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 7], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:27:11.445253"], ["id", 7]] +  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:40:20 UTC], ["updated_at", 2016-08-22 18:40:20 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804819"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SAVEPOINT active_record_1 -  (0.2ms) BEGIN - Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 29], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:40:27 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472064027"], ["id", 29]] -  (0.4ms) COMMIT - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 29], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 29]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) ROLLBACK -  (0.2ms) BEGIN - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:41:25 UTC], ["updated_at", 2016-08-22 18:41:25 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471804885"]] -  (0.6ms) COMMIT -  (0.2ms) BEGIN -  (0.1ms) BEGIN - Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 30], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:41:27 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472064086"], ["id", 30]] -  (0.6ms) COMMIT -  (0.3ms) ROLLBACK - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 30]] -  (1.6ms) COMMIT -  (0.2ms) BEGIN - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:46:59 UTC], ["updated_at", 2016-08-22 18:46:59 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471805219"]] -  (6.2ms) COMMIT -  (0.2ms) BEGIN -  (0.2ms) BEGIN - 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", 31], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:46:59 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472064419"], ["id", 31]] -  (0.5ms) COMMIT -  (0.4ms) ROLLBACK - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 31], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 31]] -  (5.9ms) COMMIT -  (0.2ms) BEGIN - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:55:49 UTC], ["updated_at", 2016-08-22 18:55:49 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471805749"]] -  (6.5ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - 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", 32], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:55:49 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472064949"], ["id", 32]] -  (0.5ms) COMMIT -  (0.4ms) ROLLBACK - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 32], ["LIMIT", 1]] - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 32]] -  (6.0ms) COMMIT -  (0.2ms) BEGIN - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:56:11 UTC], ["updated_at", 2016-08-22 18:56:11 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471805771"]] -  (0.9ms) COMMIT -  (0.2ms) BEGIN -  (0.1ms) BEGIN - 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", 33], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:56:11 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472064971"], ["id", 33]] -  (0.4ms) COMMIT -  (0.5ms) ROLLBACK - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 33], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 33]] -  (1.4ms) COMMIT -  (0.2ms) BEGIN - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:56:28 UTC], ["updated_at", 2016-08-22 18:56:28 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471805788"]] -  (1.0ms) COMMIT -  (0.2ms) BEGIN -  (0.2ms) BEGIN - 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", 34], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:56:28 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472064988"], ["id", 34]] -  (0.7ms) COMMIT -  (0.7ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 34], ["LIMIT", 1]] - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) BEGIN - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 34]] -  (5.8ms) COMMIT -  (0.2ms) BEGIN - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:56:59 UTC], ["updated_at", 2016-08-22 18:56:59 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471805819"]] -  (6.1ms) COMMIT  (0.4ms) BEGIN -  (0.1ms) BEGIN - 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", 35], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:56:59 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065019"], ["id", 35]] -  (0.4ms) COMMIT -  (0.2ms) ROLLBACK - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 35], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 35]] -  (6.2ms) COMMIT - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) BEGIN - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC]] -  (0.6ms) COMMIT -  (0.2ms) BEGIN - SQL (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 18:57:07 UTC], ["synced_id", 0], ["id", 36]] -  (0.3ms) COMMIT - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (6.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.5ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.3ms) COMMIT - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 38], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 18:57:07 UTC], ["id", 38]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 36]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 37]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 38]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471805827"]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN - 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", 39], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:57:07 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065027"], ["id", 39]] -  (0.5ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 39]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471978627"]] -  (0.4ms) COMMIT -  (0.2ms) BEGIN - Account Exists (6.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (6.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (6.6ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 41], ["LIMIT", 1]] - SQL (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 18:57:07 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 41]] -  (0.4ms) COMMIT - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 41], ["LIMIT", 1]] -  (0.2ms) BEGIN - Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] -  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 40]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 41]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.453760"], ["updated_at", "2017-11-29 18:27:11.453760"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 40]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 41]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.456648"], ["updated_at", "2017-11-29 18:27:11.456648"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 9], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:27:11.461997"], ["id", 9]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 9], ["LIMIT", 1]]  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:11 UTC], ["updated_at", 2016-08-22 18:58:11 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:11 UTC], ["updated_at", 2016-08-22 18:58:11 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 18:58:11 UTC], ["updated_at", 2016-08-22 18:58:11 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 40]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 41]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 40]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 41]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK  (0.3ms) BEGIN -  (0.5ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.3ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.9ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (2.3ms) SELECT "accounts".* FROM "accounts" -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (6.0ms) SAVEPOINT active_record_1 - Account Exists (19.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (6.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (6.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (6.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (5.7ms) SAVEPOINT active_record_1 - Account Exists (6.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 2], ["LIMIT", 1]] - SQL (6.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", 2016-08-22 19:00:17 UTC], ["id", 2]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.467785"], ["updated_at", "2017-11-29 18:27:11.467785"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 4], ["LIMIT", 1]] - SQL (2.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:00:17 UTC], ["id", 4]] -  (0.6ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] -  (0.5ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.471147"], ["updated_at", "2017-11-29 18:27:11.471147"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.6ms) SAVEPOINT active_record_1 - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:00:17 UTC], ["id", 6]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (5.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (6.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.3ms) SAVEPOINT active_record_1 - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:00:18 UTC], ["synced_id", 0], ["id", 15]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (6.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806018"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) BEGIN - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 16], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:00:18 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065218"], ["id", 16]] -  (0.2ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 16]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806018"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.2ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 17], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:00:18 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065218"], ["id", 17]] -  (0.2ms) COMMIT -  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 17], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.3ms) SAVEPOINT active_record_1 - SQL (0.5ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 17]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471978818"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (8.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 19], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:00:18 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 19]] + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 11], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:27:11.477962"], ["id", 11]]  (0.3ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]] + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 11], ["LIMIT", 1]]  (0.3ms) ROLLBACK -  (0.1ms) BEGIN +  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 20], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:05:26 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 20]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]] -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:05:26 UTC], ["synced_id", 0], ["id", 21]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806326"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 22], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:05:26 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065526"], ["id", 22]] -  (0.1ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]] - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 22]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806326"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 23], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:05:26 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065526"], ["id", 23]] -  (0.1ms) COMMIT - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 23]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471979126"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (6.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.483592"], ["updated_at", "2017-11-29 18:27:11.483592"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:27:11.501508"], ["updated_at", "2017-11-29 18:27:11.501508"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK +  (0.3ms) ROLLBACK  (0.2ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.506614"], ["updated_at", "2017-11-29 18:27:11.506614"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 34], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:05:26 UTC], ["id", 34]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.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", "2017-11-29 18:27:11.511776"], ["updated_at", "2017-11-29 18:27:11.511776"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN +  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:27 UTC], ["updated_at", 2016-08-22 19:05:27 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 36], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:05:27 UTC], ["id", 36]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 36], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:27 UTC], ["updated_at", 2016-08-22 19:05:27 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:27 UTC], ["updated_at", 2016-08-22 19:05:27 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 38], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:05:27 UTC], ["id", 38]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 38], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.5ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.519162"], ["updated_at", "2017-11-29 18:27:11.519162"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 48], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:05:34 UTC], ["id", 48]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 50], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:05:34 UTC], ["id", 50]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 50], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 52], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:05:34 UTC], ["id", 52]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 52], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:05:34 UTC], ["synced_id", 0], ["id", 53]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 54], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:05:34 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 54]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 54], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806334"]] -  (3.3ms) COMMIT -  (0.2ms) BEGIN - 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", 55], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:05:34 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065534"], ["id", 55]] -  (0.5ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 55]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806334"]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 56], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:05:34 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065534"], ["id", 56]] -  (0.4ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 56], ["LIMIT", 1]] - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 56]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471979134"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:27:11.523668"], ["updated_at", "2017-11-29 18:27:11.523668"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK -  (0.2ms) BEGIN - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:07:26 UTC], ["updated_at", 2016-08-22 19:07:26 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806446"]] -  (6.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - 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", 58], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:07:26 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065646"], ["id", 58]] -  (0.5ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 58], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 58]] -  (6.2ms) COMMIT -  (0.1ms) BEGIN +  (0.3ms) BEGIN +  (0.3ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:27:11.529034"], ["updated_at", "2017-11-29 18:27:11.529034"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.4ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:27:11.534121"], ["updated_at", "2017-11-29 18:27:11.534121"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN +  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:07:31 UTC], ["updated_at", 2016-08-22 19:07:31 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806451"]] -  (1.8ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 59], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:07:31 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065651"], ["id", 59]] -  (0.4ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 59]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:07:37 UTC], ["updated_at", 2016-08-22 19:07:37 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471979257"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:07:40 UTC], ["updated_at", 2016-08-22 19:07:40 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:07:40 UTC], ["synced_id", 0], ["id", 61]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:08:14 UTC], ["updated_at", 2016-08-22 19:08:14 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:27:11.540982"], ["updated_at", "2017-11-29 18:27:11.540982"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1512066431"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 62], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:08:14 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 62]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 62], ["LIMIT", 1]] -  (0.1ms) BEGIN  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 63], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:08:23 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 63]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 63], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471979303"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806503"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 65], ["LIMIT", 1]] - SQL (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:08:23 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065703"], ["id", 65]] -  (0.2ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 65], ["LIMIT", 1]] - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 65]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 +  (0.3ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806503"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 66], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:08:23 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472065703"], ["id", 66]] -  (0.1ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 66]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:08:23 UTC], ["synced_id", 0], ["id", 67]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 77], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 19:08:23 UTC], ["id", 77]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 79], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:08:23 UTC], ["id", 79]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 79], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 81], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:08:23 UTC], ["id", 81]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 81], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.5ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:16:14 UTC], ["updated_at", 2016-08-22 19:16:14 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806974"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.2ms) BEGIN - 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", 82], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:16:14 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066174"], ["id", 82]] -  (0.1ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 82], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:27:11.546420"], ["updated_at", "2017-11-29 18:27:11.546420"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1511893631"]] +  (1.4ms) COMMIT +  (0.4ms) BEGIN + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 21], ["LIMIT", 1]] + SQL (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:27:11.577045"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1512152831"], ["id", 21]] +  (1.0ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 82]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:16:35 UTC], ["updated_at", 2016-08-22 19:16:35 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471806995"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 83], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:16:35 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066195"], ["id", 83]] -  (0.1ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 83], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 83]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) ROLLBACK  (0.2ms) BEGIN - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:17:01 UTC], ["updated_at", 2016-08-22 19:17:01 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807021"]] -  (12.7ms) COMMIT + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]] +  (0.6ms) COMMIT  (0.2ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:27:11.584811"], ["updated_at", "2017-11-29 18:27:11.584811"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1511893631"]] +  (0.6ms) COMMIT  (0.2ms) BEGIN - 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", 84], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:17:01 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066221"], ["id", 84]] -  (0.5ms) COMMIT -  (0.3ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 84], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 84]] -  (6.4ms) COMMIT -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:17:36 UTC], ["updated_at", 2016-08-22 19:17:36 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807056"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 85], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:17:36 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066256"], ["id", 85]] -  (0.2ms) COMMIT -  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 85], ["LIMIT", 1]] - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 85]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:17:58 UTC], ["updated_at", 2016-08-22 19:17:58 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807078"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 -  (0.1ms) BEGIN - 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", 86], ["LIMIT", 1]] - SQL (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:17:58 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066278"], ["id", 86]] -  (0.2ms) COMMIT -  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 86], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 86]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) ROLLBACK  (0.2ms) BEGIN - Account Load (1.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.3ms) SAVEPOINT active_record_1 - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:25:40 UTC], ["updated_at", 2016-08-22 19:25:40 UTC]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:25:40 UTC], ["synced_id", 0], ["id", 87]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.3ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:25:40 UTC], ["updated_at", 2016-08-22 19:25:40 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 88], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:25:41 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 88]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 88], ["LIMIT", 1]] -  (0.4ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471980341"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 22], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:27:11.588820"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1512152831"], ["id", 22]] +  (0.6ms) COMMIT  (0.2ms) ROLLBACK -  (0.3ms) BEGIN - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807541"]] -  (17.5ms) COMMIT -  (0.1ms) BEGIN - Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 90], ["LIMIT", 1]] - SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:25:41 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066741"], ["id", 90]] -  (0.5ms) COMMIT - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]] + Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 90]] + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 22]]  (0.5ms) COMMIT  (0.2ms) BEGIN - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807541"]] -  (1.2ms) COMMIT -  (0.1ms) BEGIN -  (0.2ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 91], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:25:41 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066741"], ["id", 91]] -  (0.4ms) COMMIT -  (0.2ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 91], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 91]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 93], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:25:41 UTC], ["id", 93]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 95], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:25:41 UTC], ["id", 95]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 95], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 97], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:25:41 UTC], ["id", 97]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 97], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.6ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) SELECT COUNT(*) FROM "accounts" -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.5ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.3ms) BEGIN -  (0.3ms) ROLLBACK -  (1.2ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 22ms (Views: 21.5ms | ActiveRecord: 0.0ms) -  (5.9ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML -Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (6.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (6.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (6.9ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.158300"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.158300"]] -  (12.3ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 119ms (ActiveRecord: 63.8ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.196095"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.196095"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 1.4ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (1.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.209023"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.209023"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 7ms (ActiveRecord: 2.4ms) -  (0.6ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering html template + Rendered html template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN +Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.0ms) +  (2.0ms) ROLLBACK +  (0.9ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2016-08-22 19:26:57.259691"], ["oauth_access_token", "token"], ["oauth_expires_at", "1471807617"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.259691"]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN - Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 - SQL (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472066817"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:26:57.295200"]] -  (0.5ms) COMMIT - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2016-08-22 19:26:57.308334"], ["oauth_access_token", "token"], ["oauth_expires_at", "1471807617"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.308334"]] -  (0.5ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1 - SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472066817"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:26:57.313207"]] -  (0.3ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]] - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2016-08-22 19:26:57.321398"], ["oauth_access_token", "token"], ["oauth_expires_at", 1471980417], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.321398"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (6.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (6.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-08-22 19:26:57.332340"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2016-08-22 19:26:57.332340"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (6.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 7) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 7 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2016-08-22 19:26:57.349129"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (6.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (11.1ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-08-22 19:26:57.371951"], ["updated_at", "2016-08-22 19:26:57.371951"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.3ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = 8 [["synced_id", 0], ["updated_at", "2016-08-22 19:26:57.384907"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.5ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (6.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.401395"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.401395"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.410403"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.410403"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1 - SQL (1.0ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 10 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 19:26:57.413568"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.425591"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.425591"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.428526"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.428526"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 12) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 12 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 19:26:57.432221"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 12]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.437464"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.437464"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.439771"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.439771"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 14) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 19:26:57.442995"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 14]] -  (1.2ms) ROLLBACK -  (0.5ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.453171"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.453171"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (26.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.488616"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.488616"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.493835"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.493835"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.497423"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.497423"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.501278"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.501278"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.504247"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.504247"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:26:57.507929"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.507929"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:26:57.511160"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.511160"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.3ms) BEGIN +  (0.6ms) ROLLBACK +  (0.5ms) BEGIN Processing by AuthenticatedController#index as JS + Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 14ms (Views: 14.0ms | ActiveRecord: 0.0ms) -  (6.3ms) ROLLBACK -  (0.2ms) BEGIN +Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) +  (1.3ms) ROLLBACK +  (0.8ms) BEGIN Processing by AuthenticatedController#index as JS + Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (6.5ms) SAVEPOINT active_record_1 - SQL (12.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-08-22 19:27:06.574152"], ["updated_at", "2016-08-22 19:27:06.574152"]] -  (6.3ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SAVEPOINT active_record_1 - SQL (12.1ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2016-08-22 19:27:06.605044"], ["id", 1]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Exists (6.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (6.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.664349"], ["updated_at", "2016-08-22 19:27:06.664349"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:27:06.673330"], ["updated_at", "2016-08-22 19:27:06.673330"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (9.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1 - SQL (6.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 19:27:06.689457"], ["id", 3]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.701976"], ["updated_at", "2016-08-22 19:27:06.701976"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:27:06.704417"], ["updated_at", "2016-08-22 19:27:06.704417"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1 - SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 19:27:06.708419"], ["id", 5]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.721724"], ["updated_at", "2016-08-22 19:27:06.721724"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:27:06.724813"], ["updated_at", "2016-08-22 19:27:06.724813"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 7) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 19:27:06.730011"], ["id", 7]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]] -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.737955"], ["updated_at", "2016-08-22 19:27:06.737955"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (6.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (6.0ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.757032"], ["updated_at", "2016-08-22 19:27:06.757032"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SELECT COUNT(*) FROM "accounts" -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.768710"], ["updated_at", "2016-08-22 19:27:06.768710"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.773128"], ["updated_at", "2016-08-22 19:27:06.773128"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.779270"], ["updated_at", "2016-08-22 19:27:06.779270"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.782931"], ["updated_at", "2016-08-22 19:27:06.782931"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.786813"], ["updated_at", "2016-08-22 19:27:06.786813"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.790304"], ["updated_at", "2016-08-22 19:27:06.790304"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (5.9ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807626"], ["created_at", "2016-08-22 19:27:06.816365"], ["updated_at", "2016-08-22 19:27:06.816365"]] -  (11.6ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 16) LIMIT 1 - SQL (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066826"], ["updated_at", "2016-08-22 19:27:06.858577"], ["id", 16]] -  (0.6ms) COMMIT - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 16]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471807626"], ["created_at", "2016-08-22 19:27:06.868108"], ["updated_at", "2016-08-22 19:27:06.868108"]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 17) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472066826"], ["updated_at", "2016-08-22 19:27:06.873294"], ["id", 17]] -  (0.4ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]] - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 17]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471980426"], ["created_at", "2016-08-22 19:27:06.881821"], ["updated_at", "2016-08-22 19:27:06.881821"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2016-08-22 19:27:06.886273"], ["updated_at", "2016-08-22 19:27:06.886273"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 19) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 19:27:06.889179"], ["id", 19]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) -Completed 200 OK in 15ms (Views: 15.0ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) -Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.4ms) ROLLBACK -  (0.2ms) BEGIN +Completed 401 Unauthorized in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms) +  (1.7ms) ROLLBACK +  (1.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.944353"], ["updated_at", "2016-08-22 19:27:06.944353"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:25.955930"], ["updated_at", "2017-11-29 18:28:25.955930"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 1.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN +Completed 302 Found in 73ms (ActiveRecord: 16.2ms) +  (0.3ms) ROLLBACK +  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.955497"], ["updated_at", "2016-08-22 19:27:06.955497"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 6ms (ActiveRecord: 1.0ms) -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN + 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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:25.971371"], ["updated_at", "2017-11-29 18:28:25.971371"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 13ms (ActiveRecord: 5.5ms) +  (1.9ms) ROLLBACK +  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:27:06.968462"], ["updated_at", "2016-08-22 19:27:06.968462"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 0.9ms) -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.7ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK - ActiveRecord::SchemaMigration Load (1.0ms) SELECT "schema_migrations".* FROM "schema_migrations" -  (0.1ms) BEGIN + Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:26.000429"], ["updated_at", "2017-11-29 18:28:26.000429"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.3ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 17ms (ActiveRecord: 7.4ms) +  (1.1ms) ROLLBACK +  (0.4ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.7ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 14ms (Views: 10.5ms | ActiveRecord: 0.0ms) +  (1.8ms) ROLLBACK +  (0.6ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) +Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms) +  (1.1ms) ROLLBACK +  (1.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.0ms) -  (6.2ms) ROLLBACK -  (0.1ms) BEGIN +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (1.8ms) ROLLBACK +  (0.9ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +Completed 302 Found in 2ms (ActiveRecord: 0.0ms) +  (1.6ms) ROLLBACK +  (0.8ms) BEGIN +  (1.6ms) ROLLBACK +  (1.2ms) BEGIN +  (1.1ms) ROLLBACK +  (0.8ms) BEGIN +  (1.5ms) ROLLBACK +  (0.9ms) BEGIN +  (1.3ms) ROLLBACK +  (1.3ms) BEGIN +  (1.3ms) ROLLBACK +  (1.3ms) BEGIN + Account Load (1.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (1.9ms) SAVEPOINT active_record_1 + SQL (2.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-11-29 18:28:26.162567"], ["updated_at", "2017-11-29 18:28:26.162567"]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 +  (1.1ms) SAVEPOINT active_record_1 + SQL (2.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-11-29 18:28:26.172000"], ["synced_id", 0], ["id", 26]] +  (1.6ms) RELEASE SAVEPOINT active_record_1 + Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (1.5ms) ROLLBACK +  (2.3ms) BEGIN +  (1.2ms) SAVEPOINT active_record_1 + Account Exists (4.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-11-29 18:28:26.247590"], ["updated_at", "2017-11-29 18:28:26.247590"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +  (1.2ms) SAVEPOINT active_record_1 + Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 27], ["LIMIT", 1]] + SQL (1.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:28:26.261448"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 27]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 27], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.5ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 - Account Exists (6.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (6.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (5.9ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 98ms (ActiveRecord: 36.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 1.2ms) -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 5ms (ActiveRecord: 1.1ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.4ms) -Completed 200 OK in 19ms (Views: 14.2ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) -Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 3ms (Views: 2.2ms | ActiveRecord: 0.0ms) + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.276106"], ["updated_at", "2017-11-29 18:28:26.276106"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.282817"], ["updated_at", "2017-11-29 18:28:26.282817"], ["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.4ms) 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", 29], ["LIMIT", 1]] + SQL (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", "2017-11-29 18:28:26.289892"], ["id", 29]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.4ms) BEGIN +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.301724"], ["updated_at", "2017-11-29 18:28:26.301724"], ["provider", "bookingsync"], ["synced_id", 456]] +  (1.8ms) RELEASE SAVEPOINT active_record_1 +  (1.2ms) SAVEPOINT active_record_1 + Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.312020"], ["updated_at", "2017-11-29 18:28:26.312020"], ["provider", "bookingsync"], ["synced_id", 123]] +  (1.3ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 31], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:28:26.321938"], ["id", 31]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 31], ["LIMIT", 1]] +  (0.4ms) ROLLBACK +  (0.4ms) BEGIN +  (0.4ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.329464"], ["updated_at", "2017-11-29 18:28:26.329464"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (1.1ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.337340"], ["updated_at", "2017-11-29 18:28:26.337340"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 33], ["LIMIT", 1]] + SQL (1.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:28:26.344132"], ["id", 33]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 33], ["LIMIT", 1]] +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN +  (0.3ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.351628"], ["updated_at", "2017-11-29 18:28:26.351628"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (1.9ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:26.368652"], ["updated_at", "2017-11-29 18:28:26.368652"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) SELECT COUNT(*) FROM "accounts" +  (0.6ms) ROLLBACK +  (0.5ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.378299"], ["updated_at", "2017-11-29 18:28:26.378299"], ["provider", "bookingsync"], ["synced_id", 456]] +  (1.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:26.387831"], ["updated_at", "2017-11-29 18:28:26.387831"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (1.1ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.401244"], ["updated_at", "2017-11-29 18:28:26.401244"], ["provider", "bookingsync"], ["synced_id", 456]] +  (1.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.1ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:26.413326"], ["updated_at", "2017-11-29 18:28:26.413326"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) ROLLBACK +  (1.2ms) BEGIN +  (1.7ms) SAVEPOINT active_record_1 + Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:26.431479"], ["updated_at", "2017-11-29 18:28:26.431479"], ["provider", "bookingsync"], ["synced_id", 456]] +  (1.5ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.1ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:26.443901"], ["updated_at", "2017-11-29 18:28:26.443901"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.1ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) ROLLBACK +  (1.4ms) BEGIN +  (1.0ms) ROLLBACK +  (1.3ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:28:26.513908"], ["updated_at", "2017-11-29 18:28:26.513908"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1512066506"]] +  (1.5ms) RELEASE SAVEPOINT active_record_1 +  (1.6ms) ROLLBACK +  (1.6ms) BEGIN + Account Exists (2.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (2.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:28:26.535700"], ["updated_at", "2017-11-29 18:28:26.535700"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1511893706"]] +  (4.4ms) COMMIT +  (1.7ms) BEGIN + Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 43], ["LIMIT", 1]] + SQL (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:28:26.554796"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1512152906"], ["id", 43]] +  (1.8ms) COMMIT + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" +  (0.9ms) BEGIN + SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 43]] +  (1.1ms) COMMIT +  (0.4ms) BEGIN + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:28:26.568630"], ["updated_at", "2017-11-29 18:28:26.568630"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1511893706"]] +  (2.5ms) COMMIT +  (0.6ms) BEGIN + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 44], ["LIMIT", 1]] + SQL (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:28:26.579690"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1512152906"], ["id", 44]] +  (0.7ms) ROLLBACK + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 44], ["LIMIT", 1]] + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" +  (0.4ms) BEGIN + SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 44]] +  (1.0ms) COMMIT +  (0.3ms) BEGIN +  (0.4ms) ROLLBACK +  (0.3ms) BEGIN  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) +  (0.3ms) BEGIN +  (0.3ms) ROLLBACK +  (0.3ms) BEGIN +  (0.3ms) ROLLBACK +  (0.4ms) BEGIN +  (0.5ms) 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 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN +Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms) +  (0.9ms) ROLLBACK +  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (1.0ms) ROLLBACK +  (0.9ms) BEGIN +Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (5.9ms) SAVEPOINT active_record_1 - SQL (4.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:44:18 UTC], ["synced_id", 0], ["id", 4]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (6.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.5ms) SELECT COUNT(*) FROM "accounts" - Account Load (5.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 +Completed 401 Unauthorized in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms) +  (1.2ms) ROLLBACK +  (0.5ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) +  (1.1ms) ROLLBACK +  (0.8ms) BEGIN +  (1.6ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:28:54.509517"], ["updated_at", "2017-11-29 18:28:54.509517"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1512066534"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) ROLLBACK +  (0.7ms) BEGIN + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-11-29 18:28:54.520870"], ["updated_at", "2017-11-29 18:28:54.520870"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1511893734"]] +  (3.0ms) COMMIT +  (1.3ms) BEGIN + Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 46], ["LIMIT", 1]] + SQL (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:28:54.555849"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1512152934"], ["id", 46]] +  (1.1ms) COMMIT + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" +  (0.4ms) BEGIN + SQL (0.8ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 46]] +  (1.0ms) COMMIT +  (0.4ms) BEGIN +  (0.4ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.571872"], ["updated_at", "2017-11-29 18:28:54.571872"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SELECT COUNT(*) FROM "accounts" + Account Load (3.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.8ms) SAVEPOINT active_record_1 + Account Exists (3.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.599556"], ["updated_at", "2017-11-29 18:28:54.599556"], ["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" +  (1.1ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.616386"], ["updated_at", "2017-11-29 18:28:54.616386"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) SAVEPOINT active_record_1 + SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.625239"], ["updated_at", "2017-11-29 18:28:54.625239"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) ROLLBACK +  (0.5ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.640314"], ["updated_at", "2017-11-29 18:28:54.640314"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.647586"], ["updated_at", "2017-11-29 18:28:54.647586"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) ROLLBACK +  (0.5ms) BEGIN +  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 + SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.656510"], ["updated_at", "2017-11-29 18:28:54.656510"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 14], ["LIMIT", 1]] - SQL (0.8ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:44:18 UTC], ["id", 14]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 16], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:44:18 UTC], ["id", 16]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 16], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:44:18 UTC], ["id", 18]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (5.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471981458"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471808658"]] -  (6.0ms) COMMIT -  (0.1ms) BEGIN - Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:44:18 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472067858"], ["id", 20]] -  (0.5ms) COMMIT - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]] -  (0.3ms) COMMIT -  (0.2ms) BEGIN + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.663923"], ["updated_at", "2017-11-29 18:28:54.663923"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) ROLLBACK +  (0.3ms) BEGIN +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.673770"], ["updated_at", "2017-11-29 18:28:54.673770"], ["provider", "bookingsync"], ["synced_id", 456]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471808658"]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 21], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:44:18 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472067858"], ["id", 21]] -  (0.4ms) COMMIT -  (0.2ms) ROLLBACK - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]] - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" -  (0.5ms) BEGIN - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 22], ["LIMIT", 1]] - SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:44:18 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 22]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.702576"], ["updated_at", "2017-11-29 18:28:54.702576"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 56], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:28:54.707787"], ["id", 56]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) 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]] + SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.716568"], ["updated_at", "2017-11-29 18:28:54.716568"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.721965"], ["updated_at", "2017-11-29 18:28:54.721965"], ["provider", "bookingsync"], ["synced_id", 123]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.4ms) SAVEPOINT active_record_1 + Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 58], ["LIMIT", 1]] + SQL (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", "2017-11-29 18:28:54.731739"], ["id", 58]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 58], ["LIMIT", 1]] +  (0.6ms) ROLLBACK +  (0.4ms) BEGIN +  (0.4ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.740998"], ["updated_at", "2017-11-29 18:28:54.740998"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-11-29 18:28:54.745513"], ["updated_at", "2017-11-29 18:28:54.745513"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 60], ["LIMIT", 1]] + SQL (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-11-29 18:28:54.751842"], ["id", 60]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 60], ["LIMIT", 1]]  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.3ms) BEGIN +  (0.3ms) BEGIN + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-11-29 18:28:54.764959"], ["updated_at", "2017-11-29 18:28:54.764959"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + SQL (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-11-29 18:28:54.768955"], ["synced_id", 0], ["id", 61]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (1.0ms) BEGIN +  (0.9ms) ROLLBACK +  (0.4ms) BEGIN +  (0.4ms) SAVEPOINT active_record_1 + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-11-29 18:28:54.825366"], ["updated_at", "2017-11-29 18:28:54.825366"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (3.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 62], ["LIMIT", 1]] + SQL (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-11-29 18:28:54.834397"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 62]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 62], ["LIMIT", 1]] +  (0.5ms) ROLLBACK +  (1.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (6.1ms) ROLLBACK -  (0.1ms) BEGIN +  (1.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.2ms) ROLLBACK -  (0.1ms) BEGIN +  (0.8ms) ROLLBACK +  (0.8ms) BEGIN Processing by SessionsController#failure as HTML -Completed 200 OK in 20ms (Views: 19.7ms | ActiveRecord: 0.0ms) -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN + Rendering /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 12ms (Views: 8.6ms | ActiveRecord: 0.0ms) +  (1.8ms) ROLLBACK +  (1.3ms) BEGIN Processing by SessionsController#failure as HTML -Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN + Rendering /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/thilonel/workspace/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) +Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms) +  (1.2ms) ROLLBACK +  (0.7ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (7.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (6.0ms) SAVEPOINT active_record_1 - Account Exists (6.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (6.9ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.221921"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.221921"]] -  (5.7ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 95ms (ActiveRecord: 54.9ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.248888"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.248888"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.917255"], ["updated_at", "2017-11-29 18:28:54.917255"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 1.2ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN +Completed 302 Found in 12ms (ActiveRecord: 5.2ms) +  (1.3ms) ROLLBACK +  (1.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.256270"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.256270"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 4ms (ActiveRecord: 1.2ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.263016"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.263016"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.265502"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.265502"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 5 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 19:44:34.269499"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.274480"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.274480"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.276844"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.276844"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 7) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 19:44:34.280465"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.285702"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.285702"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.290251"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.290251"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 9) LIMIT 1 - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2016-08-22 19:44:34.293361"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.299124"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.299124"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SELECT COUNT(*) FROM "accounts" - Account Load (6.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.312610"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.312610"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.3ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.318348"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.318348"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.321983"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.321983"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.325648"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.325648"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.328670"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.328670"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-08-22 19:44:34.332301"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.332301"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2016-08-22 19:44:34.336126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.336126"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (6.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (12.0ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-08-22 19:44:34.356281"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2016-08-22 19:44:34.356281"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 18) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2016-08-22 19:44:34.372428"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2016-08-22 19:44:34.377675"], ["oauth_access_token", "token"], ["oauth_expires_at", "1471808674"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.377675"]] -  (0.5ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 19) LIMIT 1 - SQL (0.6ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472067874"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:44:34.397350"]] -  (0.4ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2016-08-22 19:44:34.409001"], ["oauth_access_token", "token"], ["oauth_expires_at", "1471808674"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.409001"]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 20) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472067874"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:44:34.413410"]] -  (0.3ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2016-08-22 19:44:34.419833"], ["oauth_access_token", "token"], ["oauth_expires_at", 1471981474], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.419833"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.2ms) SAVEPOINT active_record_1 - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-08-22 19:44:34.429371"], ["updated_at", "2016-08-22 19:44:34.429371"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.2ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = 22 [["synced_id", 0], ["updated_at", "2016-08-22 19:44:34.431263"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.3ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 15ms (Views: 14.0ms | ActiveRecord: 0.0ms) -  (6.4ms) ROLLBACK -  (0.2ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) -  (0.3ms) ROLLBACK -  (0.3ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 14ms (Views: 13.5ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) -Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 0ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (4.8ms) SAVEPOINT active_record_1 - Account Exists (7.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (5.9ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.606046"], ["updated_at", "2016-08-22 19:44:43.606046"]] -  (5.7ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 102ms (ActiveRecord: 54.9ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.630951"], ["updated_at", "2016-08-22 19:44:43.630951"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 1.4ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.642974"], ["updated_at", "2016-08-22 19:44:43.642974"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.936434"], ["updated_at", "2017-11-29 18:28:54.936434"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin -Completed 302 Found in 8ms (ActiveRecord: 1.4ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2016-08-22 19:44:43.676492"], ["updated_at", "2016-08-22 19:44:43.676492"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 4) LIMIT 1 - SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 19:44:43.680756"], ["id", 4]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (6.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.697595"], ["updated_at", "2016-08-22 19:44:43.697595"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:44:43.706470"], ["updated_at", "2016-08-22 19:44:43.706470"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (6.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 - SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 19:44:43.716864"], ["id", 6]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.723389"], ["updated_at", "2016-08-22 19:44:43.723389"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:44:43.725826"], ["updated_at", "2016-08-22 19:44:43.725826"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 19:44:43.729130"], ["id", 8]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.733858"], ["updated_at", "2016-08-22 19:44:43.733858"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:44:43.736567"], ["updated_at", "2016-08-22 19:44:43.736567"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2016-08-22 19:44:43.740408"], ["id", 10]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]] -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.745297"], ["updated_at", "2016-08-22 19:44:43.745297"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.752737"], ["updated_at", "2016-08-22 19:44:43.752737"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.757878"], ["updated_at", "2016-08-22 19:44:43.757878"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.761709"], ["updated_at", "2016-08-22 19:44:43.761709"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.768013"], ["updated_at", "2016-08-22 19:44:43.768013"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.771707"], ["updated_at", "2016-08-22 19:44:43.771707"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.775738"], ["updated_at", "2016-08-22 19:44:43.775738"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2016-08-22 19:44:43.779103"], ["updated_at", "2016-08-22 19:44:43.779103"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 -  (0.3ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-08-22 19:44:43.789563"], ["updated_at", "2016-08-22 19:44:43.789563"]] -  (0.3ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.6ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2016-08-22 19:44:43.792483"], ["id", 19]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (6.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471981483"], ["created_at", "2016-08-22 19:44:43.811917"], ["updated_at", "2016-08-22 19:44:43.811917"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471808683"], ["created_at", "2016-08-22 19:44:43.823005"], ["updated_at", "2016-08-22 19:44:43.823005"]] -  (7.1ms) COMMIT -  (0.2ms) BEGIN - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 21) LIMIT 1 - SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472067883"], ["updated_at", "2016-08-22 19:44:43.857595"], ["id", 21]] -  (0.4ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 - SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471808683"], ["created_at", "2016-08-22 19:44:43.865020"], ["updated_at", "2016-08-22 19:44:43.865020"]] -  (0.3ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 22) LIMIT 1 - SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472067883"], ["updated_at", "2016-08-22 19:44:43.870166"], ["id", 22]] -  (0.4ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]] - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 22]] -  (0.3ms) COMMIT -  (0.2ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/ -Completed 302 Found in 6ms (ActiveRecord: 0.0ms) -  (12.2ms) ROLLBACK -  (0.2ms) BEGIN -Processing by SessionsController#destroy as HTML -Redirected to http://test.host/signed_out -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN +Completed 302 Found in 10ms (ActiveRecord: 5.3ms) +  (1.3ms) ROLLBACK +  (0.6ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.4ms) SAVEPOINT active_record_1 - Account Exists (5.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (12.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", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (1.1ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/admin -Completed 302 Found in 101ms (ActiveRecord: 35.9ms) -  (0.5ms) ROLLBACK -  (0.2ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) SAVEPOINT active_record_1 + Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-11-29 18:28:54.955728"], ["updated_at", "2017-11-29 18:28:54.955728"], ["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 6ms (ActiveRecord: 1.3ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#create as HTML - Parameters: {"provider"=>"bookingsync"} - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -Redirected to http://test.host/ -Completed 302 Found in 5ms (ActiveRecord: 1.2ms) -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) -Completed 200 OK in 23ms (Views: 17.6ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by SessionsController#failure as HTML - Rendering /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application - Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) -Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (5.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] - SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 4], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:44:52 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 4]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] -  (0.3ms) ROLLBACK -  (0.1ms) BEGIN -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (5.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471808692"]] -  (6.4ms) COMMIT -  (0.2ms) BEGIN -  (0.1ms) BEGIN - 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", 5], ["LIMIT", 1]] - SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:44:52 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472067892"], ["id", 5]] -  (0.5ms) COMMIT -  (0.1ms) ROLLBACK - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 5], ["LIMIT", 1]] - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]] -  (0.3ms) COMMIT -  (0.2ms) BEGIN - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471808692"]] -  (0.4ms) COMMIT -  (0.1ms) BEGIN - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2016-08-22 19:44:52 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1472067892"], ["id", 6]] -  (0.3ms) COMMIT - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" -  (0.1ms) BEGIN - SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 6]] -  (0.5ms) COMMIT -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1471981492"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] -  (0.4ms) SAVEPOINT active_record_1 - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - SQL (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2016-08-22 19:44:52 UTC], ["synced_id", 0], ["id", 8]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (6.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.2ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 10], ["LIMIT", 1]] - SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:44:52 UTC], ["id", 10]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.5ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 12], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:44:52 UTC], ["id", 12]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 12], ["LIMIT", 1]] -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 14], ["LIMIT", 1]] - SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2016-08-22 19:44:52 UTC], ["id", 14]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 14], ["LIMIT", 1]] -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.4ms) SELECT COUNT(*) FROM "accounts" - Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.2ms) SELECT COUNT(*) FROM "accounts" -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.2ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:53 UTC], ["updated_at", 2016-08-22 19:44:53 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2016-08-22 19:44:53 UTC], ["updated_at", 2016-08-22 19:44:53 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.1ms) BEGIN -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] - SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2016-08-22 19:44:53 UTC], ["updated_at", 2016-08-22 19:44:53 UTC], ["provider", "bookingsync"], ["synced_id", 456]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 - Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] -  (0.1ms) SAVEPOINT active_record_1 - Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] - SQL (0.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", 2016-08-22 19:44:53 UTC], ["updated_at", 2016-08-22 19:44:53 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] -  (0.1ms) RELEASE SAVEPOINT active_record_1 -  (0.1ms) ROLLBACK -  (0.2ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.2ms) BEGIN -Processing by AuthenticatedController#index as HTML - Rendering text template - Rendered text template (0.0ms) -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) BEGIN -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.2ms) ROLLBACK -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering html template - Rendered html template (0.1ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.0ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.1ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.0ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.0ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 2ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.2ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering html template - Rendered html template (0.1ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering html template - Rendered html template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.0ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as JS - Rendering text template - Rendered text template (0.0ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.2ms) begin transaction -Processing by AuthenticatedController#index as HTML - Rendering html template - Rendered html template (0.1ms) - Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. -Filter chain halted as :authenticate_account! rendered or redirected -Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction -  (0.1ms) begin transaction -Processing by AuthenticatedController#index as HTML -Redirected to http://test.host/auth/bookingsync/?account_id= -Filter chain halted as :authenticate_account! rendered or redirected -Completed 302 Found in 1ms (ActiveRecord: 0.0ms) -  (0.1ms) rollback transaction +Completed 302 Found in 12ms (ActiveRecord: 5.9ms) +  (0.9ms) ROLLBACK