(0.4ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#failure as HTML Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 10ms (Views: 10.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#failure as HTML Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.630977"], ["updated_at", "2015-10-28 14:55:56.630977"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 51ms (ActiveRecord: 2.6ms)  (0.9ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.640757"], ["updated_at", "2015-10-28 14:55:56.640757"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.648162"], ["updated_at", "2015-10-28 14:55:56.648162"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-10-28 14:55:56.687548"], ["updated_at", "2015-10-28 14:55:56.687548"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (1.6ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-10-28 14:55:56.690615"], ["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-10-28 14:55:56.703275"], ["updated_at", "2015-10-28 14:55:56.703275"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.4ms) rollback transaction  (0.3ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.730513"], ["updated_at", "2015-10-28 14:55:56.730513"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:55:56.733493"], ["updated_at", "2015-10-28 14:55:56.733493"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:55:56.736712"], ["id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.741554"], ["updated_at", "2015-10-28 14:55:56.741554"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:55:56.745431"], ["updated_at", "2015-10-28 14:55:56.745431"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:55:56.749020"], ["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.755346"], ["updated_at", "2015-10-28 14:55:56.755346"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:55:56.758101"], ["updated_at", "2015-10-28 14:55:56.758101"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:55:56.761269"], ["id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.766035"], ["updated_at", "2015-10-28 14:55:56.766035"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.773556"], ["updated_at", "2015-10-28 14:55:56.773556"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.778572"], ["updated_at", "2015-10-28 14:55:56.778572"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.781730"], ["updated_at", "2015-10-28 14:55:56.781730"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.786643"], ["updated_at", "2015-10-28 14:55:56.786643"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.789526"], ["updated_at", "2015-10-28 14:55:56.789526"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:55:56.793733"], ["updated_at", "2015-10-28 14:55:56.793733"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:55:56.796367"], ["updated_at", "2015-10-28 14:55:56.796367"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1446130556"], ["created_at", "2015-10-28 14:55:56.802585"], ["updated_at", "2015-10-28 14:55:56.802585"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957756"], ["created_at", "2015-10-28 14:55:56.806984"], ["updated_at", "2015-10-28 14:55:56.806984"]]  (1.0ms) commit transaction  (0.3ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446216956"], ["updated_at", "2015-10-28 14:55:56.812946"], ["id", 1]]  (0.8ms) commit transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.8ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957756"], ["created_at", "2015-10-28 14:55:56.819852"], ["updated_at", "2015-10-28 14:55:56.819852"]]  (0.9ms) commit transaction  (0.1ms) begin transaction  (0.1ms) begin transaction Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446216956"], ["updated_at", "2015-10-28 14:55:56.825186"], ["id", 2]]  (0.8ms) commit transaction  (0.1ms) rollback transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.8ms) commit transaction  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#failure as HTML Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#failure as HTML Rendered /Users/manda/projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.624521"], ["updated_at", "2015-10-28 14:57:46.624521"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 46ms (ActiveRecord: 2.1ms)  (1.9ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.633729"], ["updated_at", "2015-10-28 14:57:46.633729"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.641101"], ["updated_at", "2015-10-28 14:57:46.641101"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.664531"], ["updated_at", "2015-10-28 14:57:46.664531"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (1.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.672302"], ["updated_at", "2015-10-28 14:57:46.672302"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.679017"], ["updated_at", "2015-10-28 14:57:46.679017"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.693056"], ["updated_at", "2015-10-28 14:57:46.693056"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.697565"], ["updated_at", "2015-10-28 14:57:46.697565"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.700146"], ["updated_at", "2015-10-28 14:57:46.700146"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.704766"], ["updated_at", "2015-10-28 14:57:46.704766"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-10-28 14:57:46.708263"], ["updated_at", "2015-10-28 14:57:46.708263"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.713202"], ["updated_at", "2015-10-28 14:57:46.713202"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:57:46.715195"], ["updated_at", "2015-10-28 14:57:46.715195"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:57:46.719187"], ["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.726007"], ["updated_at", "2015-10-28 14:57:46.726007"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:57:46.727914"], ["updated_at", "2015-10-28 14:57:46.727914"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:57:46.730429"], ["id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-10-28 14:57:46.734981"], ["updated_at", "2015-10-28 14:57:46.734981"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-10-28 14:57:46.736981"], ["updated_at", "2015-10-28 14:57:46.736981"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-10-28 14:57:46.739829"], ["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) rollback transaction  (0.1ms) begin transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-10-28 14:57:46.752725"], ["updated_at", "2015-10-28 14:57:46.752725"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.7ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957866"], ["created_at", "2015-10-28 14:57:46.770624"], ["updated_at", "2015-10-28 14:57:46.770624"]]  (1.1ms) commit transaction  (0.3ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446217066"], ["updated_at", "2015-10-28 14:57:46.778538"], ["id", 1]]  (0.9ms) commit transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.8ms) commit transaction  (0.1ms) begin transaction Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1445957866"], ["created_at", "2015-10-28 14:57:46.785176"], ["updated_at", "2015-10-28 14:57:46.785176"]]  (0.9ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1446217066"], ["updated_at", "2015-10-28 14:57:46.789700"], ["id", 2]]  (0.7ms) commit transaction  (0.1ms) rollback transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.9ms) commit transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1446130666"], ["created_at", "2015-10-28 14:57:46.797375"], ["updated_at", "2015-10-28 14:57:46.797375"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-10-28 14:57:46.810451"], ["updated_at", "2015-10-28 14:57:46.810451"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.6ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-10-28 14:57:46.813570"], ["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.7ms) rollback transaction