spec/dummy/log/test.log in bookingsync-engine-1.0.2 vs spec/dummy/log/test.log in bookingsync-engine-1.1.0
- old
+ new
@@ -462,5 +462,6313 @@
[1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1[0m
[1m[35mSQL (0.6ms)[0m 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]]
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
[1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1[0m
+ [1m[35mSQL (0.8ms)[0m 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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
+ [1m[36m (1.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.683667"], ["updated_at", "2016-08-22 14:36:50.683667"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 14:36:50.685618"], ["updated_at", "2016-08-22 14:36:50.685618"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m 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]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.9ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35m (0.8ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35m (1.2ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36mAccount Load (0.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36m (0.8ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.739081"], ["updated_at", "2016-08-22 14:36:50.739081"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.0ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.7ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (2.0ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 14:36:50.760088"], ["updated_at", "2016-08-22 14:36:50.760088"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.3ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.3ms)[0m begin transaction
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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]]
+ [1m[36m (0.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 1]]
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.0ms)[0m [1mbegin transaction[0m
+ [1m[35mSQL (0.3ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]
+ [1m[36m (1.0ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (1.1ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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]]
+ [1m[36m (0.9ms)[0m [1mcommit transaction[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mSQL (0.2ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]
+ [1m[36m (0.8ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.5ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["synced_id", 0], ["created_at", "2016-08-22 14:36:50.841678"], ["updated_at", "2016-08-22 14:36:50.841678"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1[0m
+ [1m[35m (0.5ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 0.8ms)
+ [1m[36m (0.4ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 7ms (ActiveRecord: 1.0ms)
+ [1m[35m (0.5ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 0.5ms)
+ [1m[36m (0.5ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[36m (0.5ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.2ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.4ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 37ms (ActiveRecord: 2.5ms)
+ [1m[36m (0.4ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
+ [1m[35m (0.5ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/admin
+Completed 302 Found in 4ms (ActiveRecord: 0.6ms)
+ [1m[36m (0.6ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#failure as HTML
+Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#failure as HTML
+Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?)[0m [["created_at", "2016-08-22 17:45:37.392037"], ["synced_id", 0], ["updated_at", "2016-08-22 17:45:37.392037"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1[0m
+ [1m[35m (0.5ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
+ [1m[36m (1.0ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", "2016-08-22 17:45:37.418847"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.418847"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", "2016-08-22 17:45:37.420912"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 17:45:37.420912"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2[0m [["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"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35m (1.4ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35m (1.4ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36m (1.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", "2016-08-22 17:45:37.472142"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.472142"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.7ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.6ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (1.3ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", "2016-08-22 17:45:37.496422"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 17:45:37.496422"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (1.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (2.1ms)[0m commit transaction
+ [1m[36m (0.4ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1[0m [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472060737"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 17:45:37.526148"]]
+ [1m[35m (1.1ms)[0m commit transaction
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.8ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.0ms)[0m commit transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.8ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36mAccount Load (0.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mSQL (0.3ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]
+ [1m[36m (0.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.7ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mrollback transaction[0m
+ [1m[36m (0.6ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 34ms (ActiveRecord: 2.5ms)
+ [1m[36m (1.7ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 5ms (ActiveRecord: 0.6ms)
+ [1m[35m (0.4ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.5ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 17:45:46.062200"], ["id", 1]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 1]]
+ [1m[35m (0.7ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.9ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36m (0.6ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.087679"], ["updated_at", "2016-08-22 17:45:46.087679"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.0ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.9ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.106001"], ["updated_at", "2016-08-22 17:45:46.106001"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.8ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.126284"], ["updated_at", "2016-08-22 17:45:46.126284"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 17:45:46.128610"], ["updated_at", "2016-08-22 17:45:46.128610"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m 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]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.0ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
+ [1m[36m (0.8ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 17:45:46.138118"], ["updated_at", "2016-08-22 17:45:46.138118"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 17:45:46.140245"], ["updated_at", "2016-08-22 17:45:46.140245"]]
+ [1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.1ms)[0m 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]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.0ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
+ [1m[36m (0.8ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.2ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.5ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (1.1ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.6ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.9ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m begin transaction
+ [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.9ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.0ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.9ms)[0m commit transaction
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 2]]
+ [1m[35m (0.8ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
+ [1m[36m (0.6ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 68ms (ActiveRecord: 3.9ms)
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.4ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 0.6ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (1.2ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:45:55 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (1.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:45:55 UTC], ["updated_at", 2016-08-22 17:45:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (1.5ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 57ms (ActiveRecord: 4.3ms)
+ [1m[35m (1.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.4ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 1.0ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:48:55 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (1.4ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (1.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:48:55 UTC], ["updated_at", 2016-08-22 17:48:55 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.8ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:51:14 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:51:14 UTC], ["updated_at", 2016-08-22 17:51:14 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 0.8ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.7ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 4ms (ActiveRecord: 0.7ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:53:49 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", 2016-08-22 17:53:49 UTC], ["updated_at", 2016-08-22 17:53:49 UTC]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:53:49 UTC], ["synced_id", 0], ["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (1.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 5ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.5ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (1.0ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:54:50 UTC], ["updated_at", 2016-08-22 17:54:50 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.9ms)[0m [1m[36mcommit transaction[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (1.1ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (1.0ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 2]]
+ [1m[35m (0.8ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.2ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 3], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.8ms)[0m [1m[36mcommit transaction[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 3]]
+ [1m[35m (0.9ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.0ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.2ms)[0m [1m[36mcommit transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 5], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:54:50 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 5]]
+ [1m[35m (0.9ms)[0m [1m[36mcommit transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["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"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+Completed 422 Unprocessable Entity in 8ms (ActiveRecord: 0.8ms)
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+Completed 422 Unprocessable Entity in 6ms (ActiveRecord: 0.7ms)
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+Completed 422 Unprocessable Entity in 5ms (ActiveRecord: 0.6ms)
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 6ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 50ms (ActiveRecord: 3.4ms)
+ [1m[35m (2.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.8ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.8ms)
+ [1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:56:08 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (1.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", 2016-08-22 17:56:08 UTC], ["updated_at", 2016-08-22 17:56:08 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 17:56:08 UTC], ["synced_id", 0], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (1.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36m (0.4ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/admin
+Completed 302 Found in 56ms (ActiveRecord: 3.4ms)
+ [1m[36m (0.5ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (1.0ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 1.4ms)
+ [1m[35m (0.5ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.7ms)
+ [1m[36m (0.5ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 2ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.3ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.2ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2016-08-22 18:00:42.473711"], ["updated_at", "2016-08-22 18:00:42.473711"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "accounts" SET "synced_id" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["synced_id", 0], ["updated_at", "2016-08-22 18:00:42.475788"], ["id", 1]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
+ [1m[36m (0.7ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.497065"], ["updated_at", "2016-08-22 18:00:42.497065"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (1.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.0ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.7ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.523557"], ["updated_at", "2016-08-22 18:00:42.523557"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.1ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.7ms)[0m [1mrollback transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:00:42.544616"], ["updated_at", "2016-08-22 18:00:42.544616"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:00:42.548093"], ["updated_at", "2016-08-22 18:00:42.548093"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.1ms)[0m rollback transaction
+ [1m[36m (0.2ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.9ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35m (0.7ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (19.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
+ [1m[36mSQL (0.1ms)[0m [1mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35m (1.0ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (8.6ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (2.5ms)[0m rollback transaction
+ [1m[36m (0.3ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (1.0ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.3ms)[0m commit transaction
+ [1m[36m (0.5ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (1.0ms)[0m commit transaction
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (1.1ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (1.0ms)[0m commit transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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]]
+ [1m[36m (1.1ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 2]]
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35mSQL (0.4ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]
+ [1m[36m (0.9ms)[0m [1mcommit transaction[0m
+ [1m[35m (0.1ms)[0m begin transaction
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
+ [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 18:00:42.739500"], ["id", 3]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.1ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1[0m [["id", 3]]
+ [1m[35m (1.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.2ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.2ms)[0m rollback transaction
+ [1m[36m (0.1ms)[0m [1mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m rollback transaction
+ [1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 10ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 66ms (ActiveRecord: 3.5ms)
+ [1m[35m (2.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.7ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 19ms (ActiveRecord: 1.7ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.9ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 8ms (ActiveRecord: 1.3ms)
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 18:00:56 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (1.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 18:00:56 UTC], ["synced_id", 0], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (1.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.3ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (1.8ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:00:56 UTC], ["updated_at", 2016-08-22 18:00:56 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.6ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.3ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (3.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (2.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.9ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (1.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (1.9ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (1.4ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", 2016-08-22 18:02:13 UTC], ["updated_at", 2016-08-22 18:02:13 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (1.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 18:02:13 UTC], ["synced_id", 0], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 18:02:13 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (1.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 8ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 0.8ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 7ms (ActiveRecord: 1.0ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.5ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 4ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 3ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 56ms (ActiveRecord: 3.4ms)
+ [1m[35m (1.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.6ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 8ms (ActiveRecord: 1.8ms)
+ [1m[35m (0.5ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 11ms (ActiveRecord: 1.4ms)
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != ?) LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 18:02:47 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
+ [1m[35m (1.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (1.1ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.6ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES (?, ?, ?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT ?[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? AND ("accounts"."id" != ?) LIMIT ?[0m [["synced_id", 123], ["id", 1], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ? WHERE "accounts"."id" = ?[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = ?[0m [["id", 1]]
+ [1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.9ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.7ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
+ [1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", 2016-08-22 18:02:47 UTC], ["updated_at", 2016-08-22 18:02:47 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = ?, "synced_id" = ? WHERE "accounts"."id" = ?[0m [["updated_at", 2016-08-22 18:02:47 UTC], ["synced_id", 0], ["id", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = ? LIMIT ?[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[31mrollback transaction[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (1.8ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.8ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (19.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (2.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.7ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 220ms (ActiveRecord: 67.1ms)
+ [1m[35m (0.8ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 10ms (ActiveRecord: 1.9ms)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.6ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 15ms (ActiveRecord: 2.1ms)
+ [1m[35m (0.7ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.6ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 2ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.8ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 4ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.7ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (4.9ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.6ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (7.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 5], ["LIMIT", 1]]
+ [1m[35mSQL (12.2ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.4ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 7], ["LIMIT", 1]]
+ [1m[35mSQL (0.9ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 7], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 9], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 9], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.5ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (2.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.4ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.6ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.9ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 18:16:12 UTC], ["updated_at", 2016-08-22 18:16:12 UTC]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 18:16:12 UTC], ["synced_id", 0], ["id", 18]]
+ [1m[35m (0.5ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.9ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 19], ["LIMIT", 1]]
+ [1m[35mSQL (1.1ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 18:16:12 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 19]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.7ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 19], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 20], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 20], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (5.8ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (7.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 20]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (1.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (1.0ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 21], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 21]]
+ [1m[35m (0.7ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+ [1m[35m (1.8ms)[0m ROLLBACK
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.7ms)[0m [1mBEGIN[0m
+ [1m[35m (0.6ms)[0m ROLLBACK
+ [1m[36m (0.5ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (1.0ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (2.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (2.3ms)[0m COMMIT
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (1.0ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m COMMIT
+ [1m[36mAccount Load (0.5ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.3ms)[0m BEGIN
+ [1m[36mSQL (0.5ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 1]]
+ [1m[35m (0.4ms)[0m COMMIT
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (2.8ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (1.1ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.8ms)[0m COMMIT
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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]]
+ [1m[36m (0.3ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36mAccount Load (0.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 2]]
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mSQL (0.6ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]]
+ [1m[36m (0.4ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.5ms)[0m BEGIN
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Load (1.3ms)[0m [1mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", "2016-08-22 18:24:32.558967"], ["updated_at", "2016-08-22 18:24:32.558967"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.8ms)[0m 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]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
+ [1m[36m (1.3ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5[0m [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 18:24:32.584375"], ["id", 5]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 5]]
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36mAccount Load (1.0ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.4ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36m (0.3ms)[0m [1mROLLBACK[0m
+ [1m[35m (1.0ms)[0m BEGIN
+ [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (1.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.614370"], ["updated_at", "2016-08-22 18:24:32.614370"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.637146"], ["updated_at", "2016-08-22 18:24:32.637146"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.6ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.5ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 15) LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.666121"], ["updated_at", "2016-08-22 18:24:32.666121"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:24:32.669796"], ["updated_at", "2016-08-22 18:24:32.669796"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.5ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (1.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 17) LIMIT 1[0m
+ [1m[35mSQL (0.7ms)[0m UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $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]]
+ [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 18:24:32.686359"], ["updated_at", "2016-08-22 18:24:32.686359"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 18:24:32.689195"], ["updated_at", "2016-08-22 18:24:32.689195"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.6ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 19) LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $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]]
+ [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]
+ [1m[36m (0.6ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m 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)
+ [1m[36m (0.3ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.7ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.6ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m 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"]]
+ [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 10ms (ActiveRecord: 2.4ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 1.2ms)
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.5ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 6ms (ActiveRecord: 1.6ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.3ms)[0m ROLLBACK
+ [1m[36m (1.7ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.4ms)[0m ROLLBACK
+ [1m[36m (1.2ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (7.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (12.6ms)[0m COMMIT
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.8ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 23) LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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]]
+ [1m[36m (6.3ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 23]]
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mSQL (0.2ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 23]]
+ [1m[36m (5.6ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (6.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (6.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 24], ["LIMIT", 1]]
+ [1m[35mSQL (2.0ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 24], ["LIMIT", 1]]
+ [1m[36mAccount Load (6.7ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 24]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 25], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 25], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 25]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 26], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.9ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 26], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 26]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 27], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.5ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (2.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 27], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 27]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 28], ["LIMIT", 1]]
+ [1m[35mSQL (2.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.7ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 28], ["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 28]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (1.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 29], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 29], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 29]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.6ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 30], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.6ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 30], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 30]]
+ [1m[35m (1.6ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 31], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 31], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 31]]
+ [1m[35m (5.9ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 32], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 32], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 32]]
+ [1m[35m (6.0ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (1.1ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.9ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 33], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 33], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 33]]
+ [1m[35m (1.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (1.0ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 34], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.7ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.7ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 34], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 34]]
+ [1m[35m (5.8ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 35], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 35], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 35]]
+ [1m[35m (6.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.7ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC]]
+ [1m[35m (0.6ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (1.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 18:57:07 UTC], ["synced_id", 0], ["id", 36]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (6.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:07 UTC], ["updated_at", 2016-08-22 18:57:07 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 38], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 36]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 37]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 38]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 39], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 39]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (6.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (6.2ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.6ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 41], ["LIMIT", 1]]
+ [1m[35mSQL (0.9ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 18:57:07 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 41]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 41], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.8ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:57:32 UTC], ["updated_at", 2016-08-22 18:57:32 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 40]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 41]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 40]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 41]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:10 UTC], ["updated_at", 2016-08-22 18:58:10 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:11 UTC], ["updated_at", 2016-08-22 18:58:11 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:11 UTC], ["updated_at", 2016-08-22 18:58:11 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 18:58:11 UTC], ["updated_at", 2016-08-22 18:58:11 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 40]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 41]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 40]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 41]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.9ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (2.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (6.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (19.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (6.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (6.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (6.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (5.7ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (6.0ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 2], ["LIMIT", 1]]
+ [1m[35mSQL (6.0ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 4], ["LIMIT", 1]]
+ [1m[35mSQL (2.1ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.6ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 4], ["LIMIT", 1]]
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.7ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.6ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 6], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 6], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (5.8ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (6.2ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:17 UTC], ["updated_at", 2016-08-22 19:00:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:00:18 UTC], ["updated_at", 2016-08-22 19:00:18 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:00:18 UTC], ["synced_id", 0], ["id", 15]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (6.0ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 16], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 16]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 17], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 17], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.5ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 17]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (8.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (1.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 19], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:00:18 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 19]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 19], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 20], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:05:26 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 20]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 20], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:05:26 UTC], ["synced_id", 0], ["id", 21]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 22], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 22], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 22]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 23], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 23]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (6.0ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 34], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:26 UTC], ["updated_at", 2016-08-22 19:05:26 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:27 UTC], ["updated_at", 2016-08-22 19:05:27 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 36], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 36], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:27 UTC], ["updated_at", 2016-08-22 19:05:27 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:27 UTC], ["updated_at", 2016-08-22 19:05:27 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 38], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 38], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.5ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 48], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 50], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 50], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 52], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 52], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:05:34 UTC], ["updated_at", 2016-08-22 19:05:34 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:05:34 UTC], ["synced_id", 0], ["id", 53]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 54], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:05:34 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 54]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 54], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (3.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 55], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.2ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 55]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 56], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 56], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 56]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 58], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 58], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 58]]
+ [1m[35m (6.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (1.8ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 59], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 59]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (1.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:07:40 UTC], ["updated_at", 2016-08-22 19:07:40 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:07:40 UTC], ["synced_id", 0], ["id", 61]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (1.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 62], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:08:14 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 62]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 62], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 63], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:08:23 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 63]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 63], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 65], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 65], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 65]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 66], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 66]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:08:23 UTC], ["synced_id", 0], ["id", 67]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 77], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 79], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 79], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:08:23 UTC], ["updated_at", 2016-08-22 19:08:23 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 81], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 81], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.5ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 82], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 82], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 82]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 83], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 83], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 83]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (12.7ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 84], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 84], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 84]]
+ [1m[35m (6.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 85], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 85], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 85]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 86], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 86], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 86]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (1.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:40 UTC], ["updated_at", 2016-08-22 19:25:40 UTC]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:25:40 UTC], ["synced_id", 0], ["id", 87]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 88], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:25:41 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 88]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 88], ["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (17.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 90], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 90]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (1.2ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 91], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 91], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 91]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 93], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 95], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 95], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 97], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 97], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.6ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.9ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.5ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (1.2ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:25:41 UTC], ["updated_at", 2016-08-22 19:25:41 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[36m (1.2ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (5.9ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#failure as HTML
+Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (6.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (6.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (6.9ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (12.3ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 119ms (ActiveRecord: 63.8ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 1.4ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.5ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (1.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/admin
+Completed 302 Found in 7ms (ActiveRecord: 2.4ms)
+ [1m[36m (0.6ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.4ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (1.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1[0m
+ [1m[35mSQL (0.7ms)[0m 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"]]
+ [1m[36m (0.5ms)[0m [1mCOMMIT[0m
+ [1m[35mAccount Load (0.7ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]]
+ [1m[36m (0.3ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.5ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (0.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5[0m [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472066817"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:26:57.313207"]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 5]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (6.0ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1[0m
+ [1m[35mSQL (6.5ms)[0m 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"]]
+ [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (6.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 7) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Load (6.6ms)[0m [1mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (11.1ms)[0m [1mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", "2016-08-22 19:26:57.371951"], ["updated_at", "2016-08-22 19:26:57.371951"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
+ [1m[36m (0.5ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (6.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:26:57.401395"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.401395"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:26:57.410403"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:26:57.410403"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1[0m
+ [1m[35mSQL (1.0ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.6ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 12) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 12[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 12]]
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 14) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 14]]
+ [1m[35m (1.2ms)[0m ROLLBACK
+ [1m[36m (0.5ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36mAccount Load (26.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:26:57.493835"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.493835"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:26:57.507929"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:26:57.507929"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+Processing by AuthenticatedController#index as JS
+ 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)
+ [1m[35m (6.3ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Load (1.0ms)[0m SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
+ [1m[36m (6.5ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (12.4ms)[0m 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"]]
+ [1m[36m (6.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (12.1ms)[0m [1mUPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3[0m [["synced_id", 0], ["updated_at", "2016-08-22 19:27:06.605044"], ["id", 1]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Exists (6.9ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (6.2ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (9.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1
+ [1m[36mSQL (6.3ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.701976"], ["updated_at", "2016-08-22 19:27:06.701976"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:27:06.704417"], ["updated_at", "2016-08-22 19:27:06.704417"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1[0m
+ [1m[35mSQL (0.6ms)[0m UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $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]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.721724"], ["updated_at", "2016-08-22 19:27:06.721724"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:27:06.724813"], ["updated_at", "2016-08-22 19:27:06.724813"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 7) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.737955"], ["updated_at", "2016-08-22 19:27:06.737955"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35mAccount Load (6.6ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (6.0ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:27:06.779270"], ["updated_at", "2016-08-22 19:27:06.779270"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (5.9ms)[0m 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"]]
+ [1m[36m (11.6ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.7ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 16) LIMIT 1[0m
+ [1m[35mSQL (1.0ms)[0m 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]]
+ [1m[36m (0.6ms)[0m [1mCOMMIT[0m
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 16]]
+ [1m[36m (0.3ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.4ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 17) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 17]]
+ [1m[35m (0.4ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 19) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m 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)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m BEGIN
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[36m (0.4ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 1.0ms)
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/admin
+Completed 302 Found in 6ms (ActiveRecord: 1.0ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.7ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36mActiveRecord::SchemaMigration Load (1.0ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.0ms)
+ [1m[35m (6.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.6ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.5ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (6.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (6.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (5.9ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 98ms (ActiveRecord: 36.0ms)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 1.2ms)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 5ms (ActiveRecord: 1.1ms)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (5.9ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (4.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:44:18 UTC], ["synced_id", 0], ["id", 4]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (6.2ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.5ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (5.8ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.1ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 14], ["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (1.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 16], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 16], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:18 UTC], ["updated_at", 2016-08-22 19:44:18 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 18], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 18], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (5.7ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.0ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (1.1ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 20], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 20]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 21], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 21], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.5ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 21]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 22], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:44:18 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 22]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 22], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (6.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#failure as HTML
+Completed 200 OK in 20ms (Views: 19.7ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.3ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#failure as HTML
+Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (7.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (6.0ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (6.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (6.9ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (5.7ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/admin
+Completed 302 Found in 95ms (ActiveRecord: 54.9ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 1.2ms)
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.4ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 4ms (ActiveRecord: 1.2ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:44:34.263016"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.263016"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:44:34.265502"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2016-08-22 19:44:34.265502"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.5ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 7) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 7]]
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 9) LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 9]]
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36mAccount Load (6.4ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:44:34.318348"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.318348"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", "2016-08-22 19:44:34.332301"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2016-08-22 19:44:34.332301"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1[0m
+ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (6.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1[0m
+ [1m[35mSQL (12.0ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.9ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 18) LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.5ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (0.9ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 19) LIMIT 1
+ [1m[36mSQL (0.6ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19[0m [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472067874"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:44:34.397350"]]
+ [1m[35m (0.4ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 19]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 20) LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20[0m [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1472067874"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2016-08-22 19:44:34.413410"]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 20]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.5ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Load (0.7ms)[0m SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = 22[0m [["synced_id", 0], ["updated_at", "2016-08-22 19:44:34.431263"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (6.4ms)[0m ROLLBACK
+ [1m[36m (0.2ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.3ms)[0m ROLLBACK
+ [1m[36m (0.3ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.6ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (4.8ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (7.5ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (5.9ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (5.7ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/
+Completed 302 Found in 102ms (ActiveRecord: 54.9ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.3ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 1.4ms)
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+Redirected to http://test.host/admin
+Completed 302 Found in 8ms (ActiveRecord: 1.4ms)
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.3ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.7ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 4) LIMIT 1
+ [1m[36mSQL (0.4ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5[0m [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2016-08-22 19:44:43.680756"], ["id", 4]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1[0m [["id", 4]]
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.2ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (6.1ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (6.6ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1
+ [1m[36mSQL (0.5ms)[0m [1mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.723389"], ["updated_at", "2016-08-22 19:44:43.723389"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:44:43.725826"], ["updated_at", "2016-08-22 19:44:43.725826"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.733858"], ["updated_at", "2016-08-22 19:44:43.733858"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.3ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2016-08-22 19:44:43.736567"], ["updated_at", "2016-08-22 19:44:43.736567"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.3ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.745297"], ["updated_at", "2016-08-22 19:44:43.745297"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.2ms)[0m BEGIN
+ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2016-08-22 19:44:43.768013"], ["updated_at", "2016-08-22 19:44:43.768013"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1[0m [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m ROLLBACK
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Load (0.1ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.2ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Load (0.8ms)[0m [1mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1[0m
+ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1
+ [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", "2016-08-22 19:44:43.789563"], ["updated_at", "2016-08-22 19:44:43.789563"]]
+ [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m 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]]
+ [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
+ [1m[35mAccount Exists (0.4ms)[0m SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
+ [1m[36mSQL (6.3ms)[0m [1mINSERT 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"[0m [["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"]]
+ [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
+ [1m[36m (0.2ms)[0m [1mROLLBACK[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.3ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.2ms)[0m 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"]]
+ [1m[36m (7.1ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.2ms)[0m BEGIN
+ [1m[36mAccount Exists (0.5ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 21) LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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]]
+ [1m[36m (0.4ms)[0m [1mCOMMIT[0m
+ [1m[35mAccount Load (0.3ms)[0m SELECT "accounts".* FROM "accounts"
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mSQL (0.2ms)[0m DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]]
+ [1m[36m (0.3ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mAccount Exists (0.4ms)[0m [1mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1[0m
+ [1m[35mSQL (0.4ms)[0m 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"]]
+ [1m[36m (0.3ms)[0m [1mCOMMIT[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36m (0.1ms)[0m [1mBEGIN[0m
+ [1m[35mAccount Exists (0.3ms)[0m SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 22) LIMIT 1
+ [1m[36mSQL (0.2ms)[0m [1mUPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.4ms)[0m COMMIT
+ [1m[36m (0.1ms)[0m [1mROLLBACK[0m
+ [1m[35mAccount Load (0.2ms)[0m SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]
+ [1m[36mAccount Load (0.2ms)[0m [1mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m BEGIN
+ [1m[36mSQL (0.2ms)[0m [1mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 22]]
+ [1m[35m (0.3ms)[0m COMMIT
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 0.0ms)
+ [1m[35m (12.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#destroy as HTML
+Redirected to http://test.host/signed_out
+Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (1.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (5.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (12.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (1.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/admin
+Completed 302 Found in 101ms (ActiveRecord: 35.9ms)
+ [1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 6ms (ActiveRecord: 1.3ms)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by SessionsController#create as HTML
+ Parameters: {"provider"=>"bookingsync"}
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+Redirected to http://test.host/
+Completed 302 Found in 5ms (ActiveRecord: 1.2ms)
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (5.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2[0m [["id", 4], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["updated_at", 2016-08-22 19:44:52 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 4]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 4], ["LIMIT", 1]]
+ [1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (5.6ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (6.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 5], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 5], ["LIMIT", 1]]
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.4ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 5]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 6], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5[0m [["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]]
+ [1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35mSQL (0.3ms)[0m [1m[31mDELETE FROM "accounts" WHERE "accounts"."id" = $1[0m [["id", 6]]
+ [1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1[0m [["LIMIT", 1]]
+ [1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3[0m [["updated_at", 2016-08-22 19:44:52 UTC], ["synced_id", 0], ["id", 8]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 0], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (6.1ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 10], ["LIMIT", 1]]
+ [1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.5ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 12], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 12], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 123]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.3ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3[0m [["synced_id", 123], ["id", 14], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6[0m [["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]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2[0m [["id", 14], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.4ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[36mAccount Load (0.4ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM "accounts"[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:52 UTC], ["updated_at", 2016-08-22 19:44:52 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.5ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:53 UTC], ["updated_at", 2016-08-22 19:44:53 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.3ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 456], ["LIMIT", 1]]
+ [1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["created_at", 2016-08-22 19:44:53 UTC], ["updated_at", 2016-08-22 19:44:53 UTC], ["provider", "bookingsync"], ["synced_id", 456]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[36mAccount Load (0.2ms)[0m [1m[34mSELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3[0m [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]
+ [1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
+ [1m[36mAccount Exists (0.2ms)[0m [1m[34mSELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2[0m [["synced_id", 123], ["LIMIT", 1]]
+ [1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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"]]
+ [1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
+ [1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+Processing by AuthenticatedController#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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
+ [1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
+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)
+ [1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m