(0.3ms) 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 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (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.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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: 2.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.021604"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:38:25.021604"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 16:38:25.023392"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.027010"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906305"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.027010"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428165505"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:38:25.030814"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.033591"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906305"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.033591"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428165505"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:38:25.035177"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.037150"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079105], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.037150"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.038928"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.038928"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.043344"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.043344"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.045397"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.045397"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.046809"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.046809"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.048564"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.048564"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.049927"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.049927"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.052165"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.052165"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.053589"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.053589"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.055261"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.055261"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.056439"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.056439"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:38:25.057760"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.059477"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.059477"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.060584"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.060584"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:38:25.061896"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.063757"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:38:25.063757"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.064871"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.064871"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 16:38:25.066201"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 16:38:25.070270"], ["uid", 0], ["updated_at", "2015-04-02 16:38:25.070270"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.094022"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.094022"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.097542"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.097542"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 16:38:25.100895"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:38:25.100895"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.675382"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.675382"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 24ms (ActiveRecord: 10.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.682110"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.682110"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.687062"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.687062"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.690742"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.690742"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.695216"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.695216"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.698850"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.698850"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.701321"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.701321"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.704446"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.704446"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.706688"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.706688"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.709334"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.709334"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:43:41.711499"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.711499"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.714425"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.714425"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.716133"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.716133"]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:43:41.720360"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.724318"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.724318"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.725904"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.725904"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:43:41.728110"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.731890"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:43:41.731890"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:43:41.733568"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.733568"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:43:41.735892"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:43:41.739050"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:43:41.739050"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:43:41.740870"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:43:41.744522"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906621"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.744522"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428165821"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:43:41.752614"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:43:41.759012"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906621"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.759012"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428165821"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:43:41.761476"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:43:41.765242"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079421], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:43:41.765242"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:43:41.773874"], ["uid", 0], ["updated_at", "2015-04-02 16:43:41.773874"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 16:44:18.732293"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:44:18.732293"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:44:18.735944"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:44:18.741822"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079458], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.741822"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:44:18.749206"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906658"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.749206"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428165858"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:44:18.757888"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.8ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:44:18.764594"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906658"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.764594"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428165858"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:44:18.767793"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.772034"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.772034"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.773914"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.773914"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:44:18.778359"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.781897"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.781897"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.784125"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.784125"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 8 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:44:18.786726"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.790305"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.790305"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.792030"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.792030"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:44:18.794237"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.798113"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.798113"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.801883"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.801883"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.805457"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.805457"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.807761"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.807761"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.811157"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.811157"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.813314"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.813314"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:44:18.816120"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:44:18.816120"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.818402"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.818402"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:44:18.826284"], ["uid", 0], ["updated_at", "2015-04-02 16:44:18.826284"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.854142"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.854142"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.859405"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.859405"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:44:18.864362"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:44:18.864362"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:47:09.713434"], ["uid", 0], ["updated_at", "2015-04-02 16:47:09.713434"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:47:09.733293"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079629], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.733293"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:47:09.736741"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906829"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.736741"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166029"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:47:09.746046"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:47:09.751610"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906829"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.751610"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166029"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:47:09.754169"]]  (0.3ms) COMMIT [refresh_token] Token update successful (4)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:47:09.757154"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:47:09.757154"]]  (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"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.8ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:47:09.759038"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.763366"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.763366"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.765201"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.765201"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:47:09.769031"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.772718"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.772718"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.774605"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.774605"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:47:09.777119"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.780652"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.780652"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.782235"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.782235"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:47:09.784451"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.788930"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.788930"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.793125"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.793125"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.796793"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.796793"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.799147"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.799147"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.802235"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.802235"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.804547"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.804547"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:09.807243"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:09.807243"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.809678"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.809678"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.815014"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.815014"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.820053"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.820053"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:09.824597"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:09.824597"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.820082"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.820082"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 5.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.826761"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.826761"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.831836"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.831836"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.853982"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.853982"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.856240"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.856240"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 5 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:47:30.859288"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.862726"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.862726"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.864469"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.864469"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:47:30.866737"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.870212"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.870212"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.871832"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.871832"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:47:30.874226"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.879268"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.879268"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.883127"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.883127"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.886456"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.886456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.888789"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.888789"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.891899"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.891899"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.894103"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.894103"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:47:30.896720"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:47:30.896720"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:47:30.898812"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.898812"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:47:30.901338"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:47:30.901338"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:47:30.903016"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (2.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:47:30.911268"], ["uid", 0], ["updated_at", "2015-04-02 16:47:30.911268"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:47:30.922337"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079650], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.922337"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token still valid (20) [refresh_token] Token requested (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:47:30.926046"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906850"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.926046"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166050"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:47:30.934442"]]  (0.1ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:47:30.940859"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906850"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:47:30.940859"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token expired, requesting a refresh... (22) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (22)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 22) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166050"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:47:30.943496"]]  (0.2ms) COMMIT [refresh_token] Token update successful (22)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:48:12.379695"], ["uid", 0], ["updated_at", "2015-04-02 16:48:12.379695"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:48:31.446827"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906892"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.446827"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166111"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:48:31.456088"]]  (0.1ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:48:31.463669"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906911"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.463669"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166111"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:48:31.466223"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:48:31.469733"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079711], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.469733"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token still valid (4) [refresh_token] Token requested (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:48:31.473835"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:48:31.473835"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:48:31.476068"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.480053"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.480053"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.485786"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.485786"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.490539"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.490539"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.493898"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.493898"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.496453"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.496453"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.498682"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.498682"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.501637"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.501637"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.504158"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.504158"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.507214"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.507214"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.509106"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.509106"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:48:31.511496"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.515322"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.515322"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.517125"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.517125"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:48:31.519251"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.522857"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:31.522857"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:31.524619"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.524619"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 19 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:48:31.526684"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.549261"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.549261"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.554030"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.554030"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:31.558516"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:31.558516"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.059872"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.059872"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.063426"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.063426"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:48:36.068398"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.072605"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.072605"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.074287"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.074287"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:48:36.076664"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.079561"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.079561"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.081369"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.081369"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:48:36.083583"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.087405"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.087405"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:36.091207"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.091207"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.094644"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.094644"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:36.097070"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.097070"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.100231"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.100231"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:36.102429"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.102429"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:48:36.105229"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:48:36.105229"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:48:36.107372"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.107372"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:48:36.112880"], ["uid", 0], ["updated_at", "2015-04-02 16:48:36.112880"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:48:36.119866"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:48:36.119866"]]  (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"."uid" IS NULL AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 16 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:48:36.121670"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:48:36.125687"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428079716], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.125687"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token still valid (17) [refresh_token] Token requested (17)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:48:36.129072"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906916"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.129072"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.9ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166116"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:48:36.137940"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:48:36.143806"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427906916"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:48:36.143806"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166116"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:48:36.146326"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] [refresh_token] Token requested (19) Account Load (0.5ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token requested (19)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:53:28.986490"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:53:28.986490"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:53:28.992639"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:53:28.992639"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:53:28.997701"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:53:28.997701"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.720445"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.720445"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.3ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.726784"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.726784"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.732129"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.732129"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.761725"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.761725"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.765970"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.765970"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.769986"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.769986"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.772218"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.772218"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.775336"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.775336"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.777787"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.777787"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.780609"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.780609"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 16:59:50.782964"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.782964"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.786149"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.786149"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.788054"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.788054"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:59:50.790895"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.794261"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.794261"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.796192"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.796192"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:59:50.798364"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.801857"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 16:59:50.801857"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 16:59:50.803431"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.803431"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 16:59:50.806277"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 16:59:50.809762"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 16:59:50.809762"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 16:59:50.811780"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 16:59:50.822069"], ["uid", 0], ["updated_at", "2015-04-02 16:59:50.822069"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:59:50.830205"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907590"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.830205"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166790"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:59:50.832616"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (20) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:59:50.836429"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907590"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.836429"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166790"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 16:59:50.838224"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 16:59:50.841342"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428080390], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 16:59:50.841342"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.380470"], ["updated_at", "2015-04-02 16:59:54.380470"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 16:59:54.383529"], ["updated_at", "2015-04-02 16:59:54.383529"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 16:59:54.390803"], ["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.394797"], ["updated_at", "2015-04-02 16:59:54.394797"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 16:59:54.396563"], ["updated_at", "2015-04-02 16:59:54.396563"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 16:59:54.399072"], ["id", 4]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.403719"], ["updated_at", "2015-04-02 16:59:54.403719"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 16:59:54.405445"], ["updated_at", "2015-04-02 16:59:54.405445"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 16:59:54.408109"], ["id", 6]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.411327"], ["updated_at", "2015-04-02 16:59:54.411327"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.415803"], ["updated_at", "2015-04-02 16:59:54.415803"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.419472"], ["updated_at", "2015-04-02 16:59:54.419472"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.421835"], ["updated_at", "2015-04-02 16:59:54.421835"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.425298"], ["updated_at", "2015-04-02 16:59:54.425298"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.428100"], ["updated_at", "2015-04-02 16:59:54.428100"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 16:59:54.431125"], ["updated_at", "2015-04-02 16:59:54.431125"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.433543"], ["updated_at", "2015-04-02 16:59:54.433543"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428080394"], ["created_at", "2015-04-02 16:59:54.436459"], ["updated_at", "2015-04-02 16:59:54.436459"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (15) [refresh_token] Token still valid (15) [refresh_token] Token requested (15)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427907594"], ["created_at", "2015-04-02 16:59:54.443812"], ["updated_at", "2015-04-02 16:59:54.443812"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (16) [refresh_token] Token expired, requesting a refresh... (16) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (16)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428166794"], ["updated_at", "2015-04-02 16:59:54.446744"], ["id", 16]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (16)  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427907594"], ["created_at", "2015-04-02 16:59:54.450967"], ["updated_at", "2015-04-02 16:59:54.450967"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token expired, requesting a refresh... (17) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (17)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428166794"], ["updated_at", "2015-04-02 16:59:54.453238"], ["id", 17]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (17) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 16:59:54.464309"], ["updated_at", "2015-04-02 16:59:54.464309"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-04-02 16:59:54.472813"], ["updated_at", "2015-04-02 16:59:54.472813"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 16:59:54.475541"], ["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.501294"], ["updated_at", "2015-04-02 16:59:54.501294"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.506750"], ["updated_at", "2015-04-02 16:59:54.506750"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 16:59:54.513233"], ["updated_at", "2015-04-02 16:59:54.513233"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:00:54.568842"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428080454], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.568842"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:00:54.573740"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907654"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.573740"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166854"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:00:54.583660"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:00:54.590784"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907654"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.590784"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428166854"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:00:54.593427"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 17:00:54.597952"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:00:54.597952"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:00:54.600415"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:00:54.606264"], ["uid", 0], ["updated_at", "2015-04-02 17:00:54.606264"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.614140"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.614140"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.616229"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.616229"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:00:54.620656"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.624599"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.624599"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.626650"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.626650"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:00:54.629251"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.635564"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.635564"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.637246"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.637246"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:00:54.639515"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.643380"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.643380"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.647120"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.647120"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.651277"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.651277"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.653427"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.653427"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.656068"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.656068"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.658099"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.658099"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:00:54.662090"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:00:54.662090"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.664514"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.664514"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.696552"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.696552"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.701402"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.701402"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:00:54.706430"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:00:54.706430"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.333507"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.333507"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 4.5ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.340407"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.340407"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.346290"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.346290"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.377146"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.377146"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.381338"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.381338"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.384568"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.384568"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.386698"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.386698"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.389879"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.389879"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.392236"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.392236"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.395309"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.395309"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:17.397749"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.397749"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.400640"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.400640"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.402327"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.402327"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:06:17.405469"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.410269"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.410269"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.412141"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.412141"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:06:17.414161"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.417354"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:17.417354"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:17.419189"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.419189"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:06:17.421516"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:06:17.427347"], ["uid", 0], ["updated_at", "2015-04-02 17:06:17.427347"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:06:17.433761"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:06:17.433761"]]  (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"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:06:17.435691"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:06:17.439385"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907977"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.439385"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167177"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:06:17.447384"]]  (0.3ms) COMMIT [refresh_token] Token update successful (20) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:06:17.453962"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907977"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.453962"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167177"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:06:17.456471"]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:06:17.459559"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428080777], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:06:17.459559"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.8ms) 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", "2015-04-02 17:06:20.770744"], ["updated_at", "2015-04-02 17:06:20.770744"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:06:20.774623"], ["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427907980"], ["created_at", "2015-04-02 17:06:20.785939"], ["updated_at", "2015-04-02 17:06:20.785939"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428167180"], ["updated_at", "2015-04-02 17:06:20.797225"], ["id", 2]]  (0.2ms) COMMIT [refresh_token] Token update successful (2) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427907980"], ["created_at", "2015-04-02 17:06:20.802177"], ["updated_at", "2015-04-02 17:06:20.802177"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428167180"], ["updated_at", "2015-04-02 17:06:20.804715"], ["id", 3]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428080780"], ["created_at", "2015-04-02 17:06:20.807873"], ["updated_at", "2015-04-02 17:06:20.807873"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token still valid (4) [refresh_token] Token requested (4)  (0.1ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.816136"], ["updated_at", "2015-04-02 17:06:20.816136"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.821339"], ["updated_at", "2015-04-02 17:06:20.821339"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.825243"], ["updated_at", "2015-04-02 17:06:20.825243"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.828422"], ["updated_at", "2015-04-02 17:06:20.828422"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.831737"], ["updated_at", "2015-04-02 17:06:20.831737"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.834427"], ["updated_at", "2015-04-02 17:06:20.834427"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.838065"], ["updated_at", "2015-04-02 17:06:20.838065"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.841284"], ["updated_at", "2015-04-02 17:06:20.841284"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.844285"], ["updated_at", "2015-04-02 17:06:20.844285"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:06:20.845939"], ["updated_at", "2015-04-02 17:06:20.845939"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:06:20.848711"], ["id", 14]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.852074"], ["updated_at", "2015-04-02 17:06:20.852074"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:06:20.853920"], ["updated_at", "2015-04-02 17:06:20.853920"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:06:20.856656"], ["id", 16]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:06:20.860078"], ["updated_at", "2015-04-02 17:06:20.860078"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:06:20.861817"], ["updated_at", "2015-04-02 17:06:20.861817"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:06:20.864315"], ["id", 18]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:06:20.870557"], ["updated_at", "2015-04-02 17:06:20.870557"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.910550"], ["updated_at", "2015-04-02 17:06:20.910550"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 2.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.916724"], ["updated_at", "2015-04-02 17:06:20.916724"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:06:20.922468"], ["updated_at", "2015-04-02 17:06:20.922468"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN 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: 2.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:06:38.167772"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428080798], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.167772"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:06:38.173317"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907998"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.173317"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167198"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:06:38.182464"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:06:38.191018"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427907998"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.191018"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167198"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:06:38.193886"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:06:38.202655"], ["uid", 0], ["updated_at", "2015-04-02 17:06:38.202655"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 17:06:38.211350"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:06:38.211350"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:06:38.213671"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.217666"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.217666"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.219702"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.219702"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:06:38.224846"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.228268"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.228268"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.230513"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.230513"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:06:38.233059"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.236234"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.236234"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.238027"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.238027"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:06:38.240325"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.243661"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.243661"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.247065"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.247065"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.250356"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.250356"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.253500"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.253500"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.256671"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.256671"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.258790"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.258790"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:06:38.261685"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:06:38.261685"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.264128"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.264128"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.281123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.281123"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.286698"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.286698"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:06:38.291478"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:06:38.291478"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:08:51.358710"], ["uid", 0], ["updated_at", "2015-04-02 17:08:51.358710"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:08:51.373722"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428080931], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.373722"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:08:51.378082"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908131"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.378082"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167331"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:08:51.386942"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:08:51.393623"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908131"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.393623"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167331"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:08:51.396767"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.400781"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.400781"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.402601"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.402601"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:08:51.407051"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.410809"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.410809"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.412883"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.412883"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 8 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:08:51.415262"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.419065"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.419065"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.420861"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.420861"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 10 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:08:51.424305"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.428124"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.428124"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.432266"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.432266"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.435748"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.435748"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.438119"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.438119"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.441124"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.441124"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.443564"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.443564"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:08:51.446493"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:08:51.446493"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.448838"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.448838"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:08:51.451533"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:08:51.451533"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:08:51.453734"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.482023"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.482023"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.4ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.487600"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.487600"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:08:51.492558"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:08:51.492558"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.755353"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.755353"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 19ms (ActiveRecord: 4.7ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.763229"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.763229"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 2.3ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.768597"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.768597"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:09:17.774181"], ["uid", 0], ["updated_at", "2015-04-02 17:09:17.774181"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.782059"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.782059"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.786391"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.786391"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.789788"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.789788"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.791867"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.791867"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.795274"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.795274"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.797500"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.797500"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.800325"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.800325"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:09:17.802417"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.802417"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.805052"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.805052"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.806548"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.806548"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:09:17.809165"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.812894"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.812894"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.814375"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.814375"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:09:17.816957"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.820686"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:09:17.820686"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:09:17.822715"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.822715"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:09:17.825310"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:09:17.829398"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908157"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.829398"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167357"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:09:17.837633"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:09:17.844164"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908157"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.844164"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:09:17.847488"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428080957], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:09:17.847488"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:09:17.850822"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:09:17.850822"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.5ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:09:17.852742"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.599872"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.599872"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.602736"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.602736"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:10:38.607379"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.611297"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.611297"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.613145"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.613145"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:10:38.615467"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.619348"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.619348"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.621248"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.621248"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:10:38.623445"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.626948"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.626948"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.630194"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.630194"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.633833"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.633833"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.636301"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.636301"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.638863"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.638863"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.641380"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.641380"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:10:38.644107"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:10:38.644107"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.646503"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.646503"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:10:38.651867"], ["uid", 0], ["updated_at", "2015-04-02 17:10:38.651867"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:10:38.658738"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:10:38.658738"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 16 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:10:38.660997"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:10:38.664754"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081038], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.664754"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token still valid (17) [refresh_token] Token requested (17)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:10:38.668329"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908238"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.668329"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.3ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167438"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:10:38.676773"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:10:38.681879"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908238"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.681879"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167438"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:10:38.684319"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.697078"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.697078"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.702198"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.702198"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:10:38.706989"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:10:38.706989"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 17:11:20.267716"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:11:20.267716"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:11:20.271015"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:11:20.279384"], ["uid", 0], ["updated_at", "2015-04-02 17:11:20.279384"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.287764"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.287764"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.289737"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.289737"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:11:20.293411"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.297752"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.297752"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.0ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.299591"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.299591"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:11:20.302802"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]  (1.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.307940"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.307940"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.309914"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.309914"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 8 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:11:20.312317"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.316133"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.316133"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.319643"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.319643"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.323113"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.323113"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.325216"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.325216"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.328111"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.328111"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.330536"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.330536"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:11:20.333244"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:11:20.333244"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.335534"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.335534"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:11:20.345621"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081080], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.345621"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token still valid (17) [refresh_token] Token requested (17)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:11:20.349065"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908280"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.349065"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167480"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:11:20.357562"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:11:20.363141"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908280"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.363141"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167480"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:11:20.365569"]]  (0.1ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.389900"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.389900"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.396070"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.396070"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 2.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:11:20.401262"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:11:20.401262"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:13:33.410320"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:13:33.410320"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 4.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:13:33.416548"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:13:33.416548"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:13:33.421429"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:13:33.421429"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:13:33.452724"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908413"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:13:33.452724"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167613"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:13:33.462496"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] [refresh_token] Token requested (4) [refresh_token] Token requested (4)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:06.361727"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908566"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.361727"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167766"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:16:06.364466"]]  (0.2ms) COMMIT [refresh_token] Token update successful (5)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:06.367800"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081366], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.367800"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (6) [refresh_token] Token still valid (6) [refresh_token] Token requested (6)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 17:16:06.370774"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:16:06.370774"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 7 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:16:06.373002"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.377054"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.377054"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:06.381228"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.381228"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.384759"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.384759"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:06.389662"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.389662"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.393028"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.393028"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:06.395455"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.395455"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.398266"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.398266"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:06.400835"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.400835"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.403478"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.403478"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.405053"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.405053"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:06.407273"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.410851"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.410851"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.412805"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.412805"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 19 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:06.415272"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.418646"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:06.418646"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:06.420230"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:06.420230"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 21 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:06.422609"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:16:06.432871"], ["uid", 0], ["updated_at", "2015-04-02 17:16:06.432871"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:11.974232"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908571"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:11.974232"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167771"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:16:11.985025"]]  (0.2ms) COMMIT [refresh_token] Token update successful (1) Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]] [refresh_token] Token requested (1) [refresh_token] Token requested (1) [refresh_token] Token requested (1)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:11.995378"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908571"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:11.995378"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167771"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:16:11.998047"]]  (0.1ms) COMMIT [refresh_token] Token update successful (2)  (1.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:12.003554"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081372], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.003554"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:16:12.007084"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:16:12.007084"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:16:12.009347"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.013410"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.013410"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.019126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.019126"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.023262"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.023262"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.026452"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.026452"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.029125"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.029125"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.033159"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.033159"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.036646"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.036646"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.039144"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.039144"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.042193"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.042193"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.043826"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.043826"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:12.046115"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.048911"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.048911"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.050548"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.050548"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:12.052636"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.056175"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:12.056175"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:12.057718"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.057718"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:12.059911"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:16:12.069890"], ["uid", 0], ["updated_at", "2015-04-02 17:16:12.069890"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.094978"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.094978"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.099556"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.099556"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:12.104341"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:12.104341"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.400535"], ["updated_at", "2015-04-02 17:16:15.400535"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 5.2ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.407561"], ["updated_at", "2015-04-02 17:16:15.407561"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.413686"], ["updated_at", "2015-04-02 17:16:15.413686"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.452723"], ["updated_at", "2015-04-02 17:16:15.452723"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.457435"], ["updated_at", "2015-04-02 17:16:15.457435"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.9ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.461887"], ["updated_at", "2015-04-02 17:16:15.461887"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.464714"], ["updated_at", "2015-04-02 17:16:15.464714"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.467882"], ["updated_at", "2015-04-02 17:16:15.467882"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.470905"], ["updated_at", "2015-04-02 17:16:15.470905"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.474413"], ["updated_at", "2015-04-02 17:16:15.474413"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:15.477199"], ["updated_at", "2015-04-02 17:16:15.477199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.480408"], ["updated_at", "2015-04-02 17:16:15.480408"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:16:15.482292"], ["updated_at", "2015-04-02 17:16:15.482292"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:16:15.485783"], ["id", 13]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.489547"], ["updated_at", "2015-04-02 17:16:15.489547"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:16:15.491396"], ["updated_at", "2015-04-02 17:16:15.491396"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:16:15.494165"], ["id", 15]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:15.498476"], ["updated_at", "2015-04-02 17:16:15.498476"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:16:15.500458"], ["updated_at", "2015-04-02 17:16:15.500458"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:16:15.502886"], ["id", 17]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:16:15.513707"], ["updated_at", "2015-04-02 17:16:15.513707"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (1.2ms) 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", "2015-04-02 17:16:15.520911"], ["updated_at", "2015-04-02 17:16:15.520911"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:16:15.524204"], ["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908575"], ["created_at", "2015-04-02 17:16:15.528037"], ["updated_at", "2015-04-02 17:16:15.528037"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428167775"], ["updated_at", "2015-04-02 17:16:15.539871"], ["id", 20]]  (0.2ms) COMMIT [refresh_token] Token update successful (20) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]] [refresh_token] Token requested (20) [refresh_token] Token requested (20) [refresh_token] Token requested (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908575"], ["created_at", "2015-04-02 17:16:15.544779"], ["updated_at", "2015-04-02 17:16:15.544779"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428167775"], ["updated_at", "2015-04-02 17:16:15.547304"], ["id", 21]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081375"], ["created_at", "2015-04-02 17:16:15.550505"], ["updated_at", "2015-04-02 17:16:15.550505"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.812116"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.812116"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.818401"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.818401"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.823234"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.823234"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.4ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:16:37.854338"], ["uid", 0], ["updated_at", "2015-04-02 17:16:37.854338"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:16:37.861449"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:16:37.861449"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:16:37.863757"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.867836"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.867836"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.871887"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.871887"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.875092"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.875092"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.877625"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.877625"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.880580"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.880580"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.882712"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.882712"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.885257"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.885257"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:16:37.887675"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.887675"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.890294"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.890294"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.891858"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.891858"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:37.894035"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (1.6ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.897105"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.897105"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.900362"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.900362"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:37.902801"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.906812"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:16:37.906812"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:16:37.908540"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.908540"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 19 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:16:37.910963"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:37.918460"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908597"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.918460"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167797"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:16:37.926629"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20) [refresh_token] Token requested (20) [refresh_token] Token requested (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:37.933998"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908597"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.933998"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428167797"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:16:37.936574"]]  (0.1ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:16:37.939762"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081397], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:16:37.939762"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.268423"], ["updated_at", "2015-04-02 17:16:41.268423"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.276257"], ["updated_at", "2015-04-02 17:16:41.276257"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.283169"], ["updated_at", "2015-04-02 17:16:41.283169"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 2.3ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:16:41.311003"], ["updated_at", "2015-04-02 17:16:41.311003"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:16:41.314395"], ["id", 4]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.324231"], ["updated_at", "2015-04-02 17:16:41.324231"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.328869"], ["updated_at", "2015-04-02 17:16:41.328869"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.332505"], ["updated_at", "2015-04-02 17:16:41.332505"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.334883"], ["updated_at", "2015-04-02 17:16:41.334883"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (2.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.337619"], ["updated_at", "2015-04-02 17:16:41.337619"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.342405"], ["updated_at", "2015-04-02 17:16:41.342405"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.345258"], ["updated_at", "2015-04-02 17:16:41.345258"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:16:41.347872"], ["updated_at", "2015-04-02 17:16:41.347872"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.350612"], ["updated_at", "2015-04-02 17:16:41.350612"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:16:41.352429"], ["updated_at", "2015-04-02 17:16:41.352429"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:16:41.354940"], ["id", 14]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.358079"], ["updated_at", "2015-04-02 17:16:41.358079"]]  (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"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:16:41.359795"], ["updated_at", "2015-04-02 17:16:41.359795"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:16:41.362289"], ["id", 16]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:16:41.365768"], ["updated_at", "2015-04-02 17:16:41.365768"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:16:41.367526"], ["updated_at", "2015-04-02 17:16:41.367526"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:16:41.369817"], ["id", 18]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:16:41.377375"], ["updated_at", "2015-04-02 17:16:41.377375"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908601"], ["created_at", "2015-04-02 17:16:41.384856"], ["updated_at", "2015-04-02 17:16:41.384856"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428167801"], ["updated_at", "2015-04-02 17:16:41.396551"], ["id", 20]]  (0.2ms) COMMIT [refresh_token] Token update successful (20) [refresh_token] Token requested (20) [refresh_token] Token requested (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908601"], ["created_at", "2015-04-02 17:16:41.400931"], ["updated_at", "2015-04-02 17:16:41.400931"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428167801"], ["updated_at", "2015-04-02 17:16:41.403633"], ["id", 21]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081401"], ["created_at", "2015-04-02 17:16:41.407033"], ["updated_at", "2015-04-02 17:16:41.407033"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:20:21.152875"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081621], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.152875"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:20:21.158117"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908821"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.158117"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168021"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:20:21.167374"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:20:21.173723"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908821"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.173723"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.3ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168021"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:20:21.176901"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]] [refresh_token] Token requested (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:20:21.183818"], ["uid", 0], ["updated_at", "2015-04-02 17:20:21.183818"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:20:21.191566"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:20:21.191566"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:20:21.193593"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.196973"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.196973"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.198703"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.198703"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:20:21.202274"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.205225"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.205225"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.206731"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.206731"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:20:21.208951"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.212241"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.212241"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.213821"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.213821"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:20:21.216098"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.219764"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.219764"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.223658"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.223658"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.227009"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.227009"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.229184"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.229184"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.232292"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.232292"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.234631"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.234631"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:21.238184"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:21.238184"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.240585"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.240585"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.257606"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.257606"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.262959"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.262959"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:21.267464"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:21.267464"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:20:24.580762"], ["updated_at", "2015-04-02 17:20:24.580762"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081624"], ["created_at", "2015-04-02 17:20:24.592939"], ["updated_at", "2015-04-02 17:20:24.592939"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908824"], ["created_at", "2015-04-02 17:20:24.599812"], ["updated_at", "2015-04-02 17:20:24.599812"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168024"], ["updated_at", "2015-04-02 17:20:24.612199"], ["id", 3]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908824"], ["created_at", "2015-04-02 17:20:24.618466"], ["updated_at", "2015-04-02 17:20:24.618466"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168024"], ["updated_at", "2015-04-02 17:20:24.621465"], ["id", 4]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] [refresh_token] Token requested (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:20:24.626324"], ["updated_at", "2015-04-02 17:20:24.626324"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:20:24.628368"], ["id", 5]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.635165"], ["updated_at", "2015-04-02 17:20:24.635165"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:20:24.637505"], ["updated_at", "2015-04-02 17:20:24.637505"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:20:24.640645"], ["id", 7]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.644172"], ["updated_at", "2015-04-02 17:20:24.644172"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:20:24.646113"], ["updated_at", "2015-04-02 17:20:24.646113"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:20:24.648810"], ["id", 9]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.652758"], ["updated_at", "2015-04-02 17:20:24.652758"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:20:24.654864"], ["updated_at", "2015-04-02 17:20:24.654864"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:20:24.657431"], ["id", 11]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.660915"], ["updated_at", "2015-04-02 17:20:24.660915"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.665802"], ["updated_at", "2015-04-02 17:20:24.665802"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.669437"], ["updated_at", "2015-04-02 17:20:24.669437"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.672046"], ["updated_at", "2015-04-02 17:20:24.672046"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.674839"], ["updated_at", "2015-04-02 17:20:24.674839"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.677199"], ["updated_at", "2015-04-02 17:20:24.677199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:24.679848"], ["updated_at", "2015-04-02 17:20:24.679848"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.682217"], ["updated_at", "2015-04-02 17:20:24.682217"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.696976"], ["updated_at", "2015-04-02 17:20:24.696976"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.703353"], ["updated_at", "2015-04-02 17:20:24.703353"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:24.709772"], ["updated_at", "2015-04-02 17:20:24.709772"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:20:43.682899"], ["uid", 0], ["updated_at", "2015-04-02 17:20:43.682899"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:20:43.705338"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081643], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.705338"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:20:43.709690"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908843"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.709690"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168043"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:20:43.718756"]]  (0.1ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:20:43.725334"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908843"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.725334"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168043"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:20:43.727825"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 17:20:43.732260"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:20:43.732260"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:20:43.734324"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.738432"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.738432"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.740259"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.740259"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:20:43.744041"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.747598"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.747598"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.749448"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.749448"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:20:43.752010"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.755538"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.755538"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.757425"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.757425"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:20:43.759716"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.763123"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.763123"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.767221"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.767221"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.771222"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.771222"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.773627"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.773627"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.776767"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.776767"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.778916"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.778916"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:20:43.781440"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:20:43.781440"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.783474"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.783474"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.788855"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.788855"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.793742"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.793742"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:20:43.798553"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:20:43.798553"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908847"], ["created_at", "2015-04-02 17:20:47.079203"], ["updated_at", "2015-04-02 17:20:47.079203"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168047"], ["updated_at", "2015-04-02 17:20:47.093533"], ["id", 1]]  (0.2ms) COMMIT [refresh_token] Token update successful (1) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908847"], ["created_at", "2015-04-02 17:20:47.103040"], ["updated_at", "2015-04-02 17:20:47.103040"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168047"], ["updated_at", "2015-04-02 17:20:47.106662"], ["id", 2]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081647"], ["created_at", "2015-04-02 17:20:47.110946"], ["updated_at", "2015-04-02 17:20:47.110946"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.114503"], ["updated_at", "2015-04-02 17:20:47.114503"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.120053"], ["updated_at", "2015-04-02 17:20:47.120053"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.124249"], ["updated_at", "2015-04-02 17:20:47.124249"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.127344"], ["updated_at", "2015-04-02 17:20:47.127344"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.131020"], ["updated_at", "2015-04-02 17:20:47.131020"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.133975"], ["updated_at", "2015-04-02 17:20:47.133975"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.137411"], ["updated_at", "2015-04-02 17:20:47.137411"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.140199"], ["updated_at", "2015-04-02 17:20:47.140199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.143627"], ["updated_at", "2015-04-02 17:20:47.143627"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:20:47.145535"], ["updated_at", "2015-04-02 17:20:47.145535"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:20:47.148241"], ["id", 13]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.151301"], ["updated_at", "2015-04-02 17:20:47.151301"]]  (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"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:20:47.152975"], ["updated_at", "2015-04-02 17:20:47.152975"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:20:47.155544"], ["id", 15]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:20:47.159295"], ["updated_at", "2015-04-02 17:20:47.159295"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:20:47.161350"], ["updated_at", "2015-04-02 17:20:47.161350"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:20:47.164110"], ["id", 17]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:20:47.167770"], ["updated_at", "2015-04-02 17:20:47.167770"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:20:47.169620"], ["id", 18]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:20:47.177477"], ["updated_at", "2015-04-02 17:20:47.177477"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.210097"], ["updated_at", "2015-04-02 17:20:47.210097"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.216207"], ["updated_at", "2015-04-02 17:20:47.216207"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:20:47.222116"], ["updated_at", "2015-04-02 17:20:47.222116"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 17:21:24.800287"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:21:24.800287"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:21:24.803451"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:24.809987"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081684], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.809987"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:24.817307"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908884"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.817307"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168084"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:21:24.826807"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:24.832532"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908884"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.832532"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168084"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:21:24.835007"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:21:24.841838"], ["uid", 0], ["updated_at", "2015-04-02 17:21:24.841838"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.852896"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.852896"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.855050"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.855050"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:24.858975"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.863061"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.863061"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.864749"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.864749"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:24.867027"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.870352"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.870352"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.872222"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.872222"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:24.874488"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.878132"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.878132"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.881920"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.881920"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.885142"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.885142"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.887271"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.887271"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.890234"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.890234"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.892643"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.892643"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:24.895180"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:24.895180"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.897333"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.897333"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.922124"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.922124"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.926790"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.926790"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:24.931027"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:24.931027"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (1.0ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.321481"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.321481"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.328219"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.328219"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.333388"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.333388"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.349568"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.349568"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.354000"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.354000"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.357536"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.357536"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.359744"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.359744"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.362427"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.362427"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.364618"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.364618"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.367101"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.367101"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:43.369233"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.369233"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.372027"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.372027"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.373596"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.373596"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:43.376228"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.379351"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.379351"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.380949"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.380949"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:43.383060"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.386575"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:43.386575"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:43.390349"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.390349"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:43.392807"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:21:43.396620"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:21:43.396620"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:21:43.398410"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:43.402138"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908903"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.402138"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168103"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:21:43.410733"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:43.417883"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908903"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.417883"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168103"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:21:43.420658"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:43.424116"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081703], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:43.424116"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:21:43.428989"], ["uid", 0], ["updated_at", "2015-04-02 17:21:43.428989"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:21:46.682945"], ["updated_at", "2015-04-02 17:21:46.682945"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081706"], ["created_at", "2015-04-02 17:21:46.702670"], ["updated_at", "2015-04-02 17:21:46.702670"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908906"], ["created_at", "2015-04-02 17:21:46.706588"], ["updated_at", "2015-04-02 17:21:46.706588"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168106"], ["updated_at", "2015-04-02 17:21:46.718410"], ["id", 3]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908906"], ["created_at", "2015-04-02 17:21:46.724784"], ["updated_at", "2015-04-02 17:21:46.724784"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168106"], ["updated_at", "2015-04-02 17:21:46.727968"], ["id", 4]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.733288"], ["updated_at", "2015-04-02 17:21:46.733288"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:21:46.735276"], ["updated_at", "2015-04-02 17:21:46.735276"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:21:46.738235"], ["id", 6]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.741906"], ["updated_at", "2015-04-02 17:21:46.741906"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:21:46.744130"], ["updated_at", "2015-04-02 17:21:46.744130"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:21:46.747221"], ["id", 8]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.750679"], ["updated_at", "2015-04-02 17:21:46.750679"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:21:46.752637"], ["updated_at", "2015-04-02 17:21:46.752637"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:21:46.755545"], ["id", 10]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.759263"], ["updated_at", "2015-04-02 17:21:46.759263"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.763559"], ["updated_at", "2015-04-02 17:21:46.763559"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.767088"], ["updated_at", "2015-04-02 17:21:46.767088"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.769582"], ["updated_at", "2015-04-02 17:21:46.769582"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.772536"], ["updated_at", "2015-04-02 17:21:46.772536"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.775060"], ["updated_at", "2015-04-02 17:21:46.775060"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:21:46.777740"], ["updated_at", "2015-04-02 17:21:46.777740"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.780237"], ["updated_at", "2015-04-02 17:21:46.780237"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) 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", "2015-04-02 17:21:46.783252"], ["updated_at", "2015-04-02 17:21:46.783252"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:21:46.784942"], ["id", 19]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN 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.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.815332"], ["updated_at", "2015-04-02 17:21:46.815332"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.7ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.821587"], ["updated_at", "2015-04-02 17:21:46.821587"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:21:46.827453"], ["updated_at", "2015-04-02 17:21:46.827453"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (2.0ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.297403"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.297403"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.6ms)  (0.8ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.304418"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.304418"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.309596"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.309596"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:21:57.323340"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:21:57.323340"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:21:57.326018"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:21:57.332393"], ["uid", 0], ["updated_at", "2015-04-02 17:21:57.332393"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.343579"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.343579"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.347759"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.347759"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.351679"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.351679"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.354013"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.354013"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.356956"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.356956"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.359162"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.359162"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.361815"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.361815"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:21:57.363904"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.363904"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.367470"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.367470"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.369342"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.369342"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:57.371633"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.374602"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.374602"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.376263"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.376263"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:57.378439"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.381845"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:21:57.381845"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:21:57.383457"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.383457"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 19 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:21:57.385596"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (1.1ms) BEGIN SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:21:57.395597"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908917"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:21:57.395597"]]  (0.4ms) COMMIT  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.455131"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.455131"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 5.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.462417"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.462417"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.9ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.468023"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.468023"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:22:20.498769"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:22:20.498769"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:22:20.501382"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.509419"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.509419"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.514199"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.514199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.517716"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.517716"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.520061"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.520061"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.522784"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.522784"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.525108"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.525108"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.527658"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.527658"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:20.529837"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.529837"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.532425"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.532425"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.534000"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.534000"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:22:20.536138"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.538959"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.538959"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.540544"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.540544"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:22:20.542608"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.546225"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:20.546225"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:20.547801"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.547801"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:22:20.549934"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:22:20.554375"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908940"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.554375"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168140"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:22:20.562906"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:22:20.568654"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908940"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.568654"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168140"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:22:20.571151"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:22:20.574906"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081740], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:22:20.574906"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:22:20.581003"], ["uid", 0], ["updated_at", "2015-04-02 17:22:20.581003"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.861456"], ["updated_at", "2015-04-02 17:22:23.861456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.1ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.868154"], ["updated_at", "2015-04-02 17:22:23.868154"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 2.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.875494"], ["updated_at", "2015-04-02 17:22:23.875494"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.4ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:22:23.900463"], ["updated_at", "2015-04-02 17:22:23.900463"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (2.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:22:23.910304"], ["updated_at", "2015-04-02 17:22:23.910304"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:22:23.913353"], ["id", 5]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.918609"], ["updated_at", "2015-04-02 17:22:23.918609"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.922373"], ["updated_at", "2015-04-02 17:22:23.922373"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.925908"], ["updated_at", "2015-04-02 17:22:23.925908"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.928359"], ["updated_at", "2015-04-02 17:22:23.928359"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.931311"], ["updated_at", "2015-04-02 17:22:23.931311"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.934215"], ["updated_at", "2015-04-02 17:22:23.934215"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.937454"], ["updated_at", "2015-04-02 17:22:23.937454"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:23.940162"], ["updated_at", "2015-04-02 17:22:23.940162"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.943074"], ["updated_at", "2015-04-02 17:22:23.943074"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:22:23.945096"], ["updated_at", "2015-04-02 17:22:23.945096"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:22:23.947682"], ["id", 15]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.950920"], ["updated_at", "2015-04-02 17:22:23.950920"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:22:23.952748"], ["updated_at", "2015-04-02 17:22:23.952748"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:22:23.955322"], ["id", 17]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:23.958781"], ["updated_at", "2015-04-02 17:22:23.958781"]]  (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"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:22:23.960561"], ["updated_at", "2015-04-02 17:22:23.960561"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:22:23.963492"], ["id", 19]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908943"], ["created_at", "2015-04-02 17:22:23.967426"], ["updated_at", "2015-04-02 17:22:23.967426"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168143"], ["updated_at", "2015-04-02 17:22:23.980329"], ["id", 20]]  (0.1ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908943"], ["created_at", "2015-04-02 17:22:23.984628"], ["updated_at", "2015-04-02 17:22:23.984628"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168143"], ["updated_at", "2015-04-02 17:22:23.987379"], ["id", 21]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081743"], ["created_at", "2015-04-02 17:22:23.990827"], ["updated_at", "2015-04-02 17:22:23.990827"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:43.940834"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:43.940834"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.7ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:43.948164"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:43.948164"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:43.953260"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:43.953260"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:22:43.973260"], ["uid", 0], ["updated_at", "2015-04-02 17:22:43.973260"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.7ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:43.980021"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:43.980021"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:43.984731"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:43.984731"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:43.988143"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:43.988143"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:43.990463"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:43.990463"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:43.993204"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:43.993204"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:43.995205"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:43.995205"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:43.997971"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:43.997971"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:22:44.000222"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.000222"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:44.003084"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:44.003084"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:44.004766"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.004766"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:22:44.007511"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:44.010833"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:44.010833"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:44.012811"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.012811"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:22:44.014845"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:44.018505"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:22:44.018505"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:22:44.020653"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.020653"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:22:44.022669"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 17:22:44.029511"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:22:44.029511"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:22:44.031596"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:22:44.035385"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908964"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.035385"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.5ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168164"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:22:44.045979"]]  (0.1ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:22:44.051659"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908964"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.051659"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168164"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:22:44.054074"]]  (0.1ms) COMMIT [refresh_token] Token update successful (21)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:22:44.057051"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081764], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:22:44.057051"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.331320"], ["updated_at", "2015-04-02 17:22:47.331320"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 22ms (ActiveRecord: 4.7ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.338168"], ["updated_at", "2015-04-02 17:22:47.338168"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.344081"], ["updated_at", "2015-04-02 17:22:47.344081"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by 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.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081767"], ["created_at", "2015-04-02 17:22:47.371021"], ["updated_at", "2015-04-02 17:22:47.371021"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token still valid (4) [refresh_token] Token requested (4)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908967"], ["created_at", "2015-04-02 17:22:47.375420"], ["updated_at", "2015-04-02 17:22:47.375420"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168167"], ["updated_at", "2015-04-02 17:22:47.388599"], ["id", 5]]  (0.3ms) COMMIT [refresh_token] Token update successful (5)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908967"], ["created_at", "2015-04-02 17:22:47.392992"], ["updated_at", "2015-04-02 17:22:47.392992"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (6) [refresh_token] Token expired, requesting a refresh... (6) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (6)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168167"], ["updated_at", "2015-04-02 17:22:47.395787"], ["id", 6]]  (0.2ms) COMMIT [refresh_token] Token update successful (6)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.399374"], ["updated_at", "2015-04-02 17:22:47.399374"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:22:47.401447"], ["updated_at", "2015-04-02 17:22:47.401447"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:22:47.404055"], ["id", 8]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.407390"], ["updated_at", "2015-04-02 17:22:47.407390"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:22:47.409618"], ["updated_at", "2015-04-02 17:22:47.409618"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:22:47.412661"], ["id", 10]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.418209"], ["updated_at", "2015-04-02 17:22:47.418209"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:22:47.420112"], ["updated_at", "2015-04-02 17:22:47.420112"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:22:47.422730"], ["id", 12]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 12]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.426465"], ["updated_at", "2015-04-02 17:22:47.426465"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.430235"], ["updated_at", "2015-04-02 17:22:47.430235"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.434051"], ["updated_at", "2015-04-02 17:22:47.434051"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.436676"], ["updated_at", "2015-04-02 17:22:47.436676"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.439619"], ["updated_at", "2015-04-02 17:22:47.439619"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.442312"], ["updated_at", "2015-04-02 17:22:47.442312"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:22:47.446492"], ["updated_at", "2015-04-02 17:22:47.446492"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:22:47.449373"], ["updated_at", "2015-04-02 17:22:47.449373"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:22:47.454897"], ["updated_at", "2015-04-02 17:22:47.454897"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:22:47.465157"], ["updated_at", "2015-04-02 17:22:47.465157"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:22:47.467343"], ["id", 22]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.897163"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.897163"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 4.3ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.904365"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.904365"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.909433"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.909433"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:23:13.941450"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:23:13.941450"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:23:13.944187"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.948716"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.948716"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (1.8ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.954409"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.954409"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.958007"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.958007"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.960833"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.960833"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.963461"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.963461"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.965913"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.965913"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.968541"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.968541"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:23:13.971159"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.971159"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.973731"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.973731"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.975323"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.975323"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:23:13.977389"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.980317"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.980317"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.982068"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.982068"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:23:13.983916"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.987309"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:23:13.987309"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:23:13.988931"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.988931"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:23:13.991171"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:23:13.995165"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908993"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:23:13.995165"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168193"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:23:14.003667"]]  (0.1ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (1.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:23:14.041104"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427908994"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:23:14.041104"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168194"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:23:14.043861"]]  (0.1ms) COMMIT [refresh_token] Token update successful (20)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:23:14.047829"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081794], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:23:14.047829"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:23:14.053121"], ["uid", 0], ["updated_at", "2015-04-02 17:23:14.053121"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.391514"], ["updated_at", "2015-04-02 17:23:17.391514"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.1ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.398285"], ["updated_at", "2015-04-02 17:23:17.398285"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (1.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.405678"], ["updated_at", "2015-04-02 17:23:17.405678"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.8ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.413895"], ["updated_at", "2015-04-02 17:23:17.413895"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:23:17.416113"], ["updated_at", "2015-04-02 17:23:17.416113"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:23:17.419677"], ["id", 5]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.423013"], ["updated_at", "2015-04-02 17:23:17.423013"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:23:17.424941"], ["updated_at", "2015-04-02 17:23:17.424941"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:23:17.427519"], ["id", 7]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.431858"], ["updated_at", "2015-04-02 17:23:17.431858"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:23:17.435354"], ["updated_at", "2015-04-02 17:23:17.435354"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:23:17.438049"], ["id", 9]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.441484"], ["updated_at", "2015-04-02 17:23:17.441484"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.445794"], ["updated_at", "2015-04-02 17:23:17.445794"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.449231"], ["updated_at", "2015-04-02 17:23:17.449231"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.452233"], ["updated_at", "2015-04-02 17:23:17.452233"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.455243"], ["updated_at", "2015-04-02 17:23:17.455243"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.458043"], ["updated_at", "2015-04-02 17:23:17.458043"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:23:17.460943"], ["updated_at", "2015-04-02 17:23:17.460943"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:23:17.463360"], ["updated_at", "2015-04-02 17:23:17.463360"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081797"], ["created_at", "2015-04-02 17:23:17.466720"], ["updated_at", "2015-04-02 17:23:17.466720"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token still valid (18) [refresh_token] Token requested (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908997"], ["created_at", "2015-04-02 17:23:17.470354"], ["updated_at", "2015-04-02 17:23:17.470354"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168197"], ["updated_at", "2015-04-02 17:23:17.481792"], ["id", 19]]  (0.2ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427908997"], ["created_at", "2015-04-02 17:23:17.486322"], ["updated_at", "2015-04-02 17:23:17.486322"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168197"], ["updated_at", "2015-04-02 17:23:17.489104"], ["id", 20]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (1.7ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:23:17.528781"], ["updated_at", "2015-04-02 17:23:17.528781"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:23:17.536941"], ["updated_at", "2015-04-02 17:23:17.536941"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:23:17.539146"], ["id", 22]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.508593"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.508593"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.7ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.515234"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.515234"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.519885"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.519885"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.523373"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.523373"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.527629"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.527629"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.532219"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.532219"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.534532"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.534532"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.537648"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.537648"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.540341"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.540341"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.543037"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.543037"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:27.545572"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.545572"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.548547"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.548547"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.550166"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.550166"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:24:27.552785"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.556309"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.556309"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.558086"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.558086"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:24:27.560532"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.564519"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:27.564519"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:27.566035"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.566035"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:24:27.567872"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:24:27.571730"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909067"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.571730"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.8ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168267"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:24:27.581052"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:24:27.587577"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909067"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.587577"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168267"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:24:27.590704"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:24:27.593947"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081867], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:24:27.593947"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token still valid (20) [refresh_token] Token requested (20)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:24:27.597398"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:24:27.597398"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 21) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:24:27.599433"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:24:27.609529"], ["uid", 0], ["updated_at", "2015-04-02 17:24:27.609529"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.1ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:30.962703"], ["updated_at", "2015-04-02 17:24:30.962703"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:30.969992"], ["updated_at", "2015-04-02 17:24:30.969992"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:30.975540"], ["updated_at", "2015-04-02 17:24:30.975540"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:30.989540"], ["updated_at", "2015-04-02 17:24:30.989540"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:30.993490"], ["updated_at", "2015-04-02 17:24:30.993490"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:30.997674"], ["updated_at", "2015-04-02 17:24:30.997674"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:31.000266"], ["updated_at", "2015-04-02 17:24:31.000266"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:31.003879"], ["updated_at", "2015-04-02 17:24:31.003879"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:31.006746"], ["updated_at", "2015-04-02 17:24:31.006746"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:31.010833"], ["updated_at", "2015-04-02 17:24:31.010833"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:24:31.013536"], ["updated_at", "2015-04-02 17:24:31.013536"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:31.016491"], ["updated_at", "2015-04-02 17:24:31.016491"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:24:31.018252"], ["updated_at", "2015-04-02 17:24:31.018252"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:24:31.021423"], ["id", 13]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:31.025313"], ["updated_at", "2015-04-02 17:24:31.025313"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:24:31.027194"], ["updated_at", "2015-04-02 17:24:31.027194"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:24:31.029641"], ["id", 15]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:24:31.034031"], ["updated_at", "2015-04-02 17:24:31.034031"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:24:31.035862"], ["updated_at", "2015-04-02 17:24:31.035862"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:24:31.038622"], ["id", 17]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-04-02 17:24:31.046060"], ["updated_at", "2015-04-02 17:24:31.046060"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:24:31.048576"], ["id", 18]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427909071"], ["created_at", "2015-04-02 17:24:31.052697"], ["updated_at", "2015-04-02 17:24:31.052697"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168271"], ["updated_at", "2015-04-02 17:24:31.063862"], ["id", 19]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427909071"], ["created_at", "2015-04-02 17:24:31.068420"], ["updated_at", "2015-04-02 17:24:31.068420"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428168271"], ["updated_at", "2015-04-02 17:24:31.071688"], ["id", 20]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428081871"], ["created_at", "2015-04-02 17:24:31.075211"], ["updated_at", "2015-04-02 17:24:31.075211"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (1.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:24:31.081297"], ["updated_at", "2015-04-02 17:24:31.081297"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:24:39.982595"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428081879], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:24:39.982595"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:24:39.990458"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909079"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:24:39.990458"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168279"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:24:40.000407"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:24:40.007001"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909080"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.007001"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168280"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:24:40.010035"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.017485"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.017485"]]  (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"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.019495"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.019495"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:24:40.024273"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.027996"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.027996"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.029829"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.029829"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:24:40.032234"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.035530"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.035530"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.037188"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.037188"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:24:40.039340"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (1.8ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.043156"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.043156"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.049014"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.049014"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (1.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.052821"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.052821"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.056639"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.056639"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.059562"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.059562"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.061676"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.061676"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:24:40.064083"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:24:40.064083"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.066151"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.066151"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:24:40.068740"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:24:40.068740"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:24:40.070512"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:24:40.076238"], ["uid", 0], ["updated_at", "2015-04-02 17:24:40.076238"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.105270"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.105270"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.110312"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.110312"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:24:40.115227"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:24:40.115227"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 17:30:10.263766"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:30:10.263766"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:30:10.266815"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:30:10.275467"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909410"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.275467"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168610"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:30:10.284542"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:30:10.291038"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909410"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.291038"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168610"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:30:10.294594"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:30:10.297865"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082210], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.297865"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token still valid (4) [refresh_token] Token requested (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.301546"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.301546"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.306802"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.306802"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.310824"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.310824"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.313415"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.313415"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (1.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.316411"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.316411"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.319493"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.319493"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.322688"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.322688"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.325032"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.325032"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.328100"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.328100"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.7ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.330103"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.330103"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:30:10.334178"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.337413"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.337413"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.339094"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.339094"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:30:10.341531"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.344844"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:30:10.344844"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:30:10.346431"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.346431"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:30:10.348617"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:30:10.354645"], ["uid", 0], ["updated_at", "2015-04-02 17:30:10.354645"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.379211"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.379211"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.383619"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.383619"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:30:10.388305"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:30:10.388305"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 17:32:24.222654"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:32:24.222654"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:32:24.226126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.232319"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.232319"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.234517"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.234517"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 3 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:32:24.238790"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.243217"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.243217"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.245275"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.245275"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:32:24.247562"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.251598"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.251598"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.253530"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.253530"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:32:24.256038"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (1.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.260037"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.260037"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.265260"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.265260"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.268682"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.268682"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.271096"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.271096"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.274311"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.274311"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.276717"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.276717"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:32:24.279504"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:32:24.279504"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.281930"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.281930"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:32:24.287672"], ["uid", 0], ["updated_at", "2015-04-02 17:32:24.287672"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:32:24.304441"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082344], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.304441"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token still valid (17) [refresh_token] Token requested (17)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:32:24.308135"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909544"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.308135"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168744"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:32:24.316530"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:32:24.321975"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909544"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.321975"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.349682"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.349682"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.7ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.355423"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.355423"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:32:24.360997"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:32:24.360997"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.727701"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.727701"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.4ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.733816"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.733816"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.739047"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.739047"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:33:28.757205"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:33:28.757205"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:33:28.759648"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:33:28.766118"], ["uid", 0], ["updated_at", "2015-04-02 17:33:28.766118"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.772790"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.772790"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.776994"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.776994"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.780503"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.780503"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.782816"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.782816"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.785604"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.785604"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.787854"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.787854"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.790826"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.790826"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:33:28.793152"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.793152"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.796037"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.796037"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.798202"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.798202"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:33:28.800479"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.803513"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.803513"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.805402"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.805402"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:33:28.807393"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.811095"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:33:28.811095"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:33:28.812917"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.812917"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 19 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:33:28.815070"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:33:28.819101"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909608"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.819101"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:33:28.822556"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909608"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.822556"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168808"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:33:28.832243"]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:33:28.837772"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082408], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:33:28.837772"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.756482"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.756482"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.6ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.763227"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.763227"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.768742"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.768742"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.790615"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.790615"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.792729"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.792729"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:36:04.795663"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.798552"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.798552"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.800258"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.800258"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:36:04.802393"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.805875"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.805875"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.807451"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.807451"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:36:04.809723"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.813498"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.813498"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.817187"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.817187"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.820254"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.820254"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.822313"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.822313"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.824900"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.824900"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.827180"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.827180"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:04.829682"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:04.829682"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:04.831869"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.831869"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:36:04.838393"], ["uid", 0], ["updated_at", "2015-04-02 17:36:04.838393"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:36:04.845094"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082564], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.845094"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token still valid (19) [refresh_token] Token requested (19)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:36:04.849043"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909764"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:36:04.849043"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428168964"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:36:04.857640"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:36:37.937716"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909797"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:36:37.937716"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.8ms) 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", "2015-04-02 17:36:37.944713"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:36:37.944713"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:36:37.948326"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.613579"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.613579"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.617293"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.617293"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:36:54.622324"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.626409"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.626409"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.628333"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.628333"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:36:54.630679"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.634842"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.634842"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.636627"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.636627"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:36:54.638835"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.642164"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.642164"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:54.646049"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.646049"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.649629"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.649629"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:54.652001"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.652001"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.655545"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.655545"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:54.657730"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.657730"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:36:54.660272"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:36:54.660272"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:36:54.662492"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.662492"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:36:54.665319"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:36:54.665319"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 15 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:36:54.667006"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:36:54.670628"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082614], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.670628"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (16) [refresh_token] Token still valid (16) [refresh_token] Token requested (16)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:36:54.673980"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909814"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:36:54.673980"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token expired, requesting a refresh... (17) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (17)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 17 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169014"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:36:54.681616"]]  (0.2ms) COMMIT [refresh_token] Token update successful (17)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:37:00.682325"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909820"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:37:00.682325"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169020"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:37:00.685095"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:37:44.739819"], ["uid", 0], ["updated_at", "2015-04-02 17:37:44.739819"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.9ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:44.751504"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:44.751504"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:44.756657"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:44.756657"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:44.761355"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:44.761355"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.131583"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.131583"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 19ms (ActiveRecord: 4.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.138546"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.138546"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.144199"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.144199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.151954"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.151954"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.156469"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.156469"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.159812"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.159812"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.162191"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.162191"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.165208"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.165208"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.167830"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.167830"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.170905"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.170905"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:37:49.173225"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.173225"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.176117"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.176117"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.177734"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.177734"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:37:49.180461"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.184101"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.184101"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.185706"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.185706"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:37:49.187816"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.191356"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:37:49.191356"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:37:49.193042"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.193042"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:37:49.195080"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (1.9ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:37:49.201448"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909869"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.201448"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169069"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:37:49.209983"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:37:49.215616"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909869"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.215616"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169069"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:37:49.218064"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:37:49.222046"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082669], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:37:49.222046"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token still valid (20) [refresh_token] Token requested (20)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:37:49.224698"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:37:49.224698"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:37:49.226310"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 21]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:37:49.232779"], ["uid", 0], ["updated_at", "2015-04-02 17:37:49.232779"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.2ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (1.0ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.5ms) 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", "2015-04-02 17:37:52.542636"], ["updated_at", "2015-04-02 17:37:52.542636"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:37:52.545878"], ["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.559515"], ["updated_at", "2015-04-02 17:37:52.559515"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:37:52.561699"], ["updated_at", "2015-04-02 17:37:52.561699"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:37:52.565353"], ["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.568628"], ["updated_at", "2015-04-02 17:37:52.568628"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:37:52.570356"], ["updated_at", "2015-04-02 17:37:52.570356"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:37:52.572737"], ["id", 5]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.575650"], ["updated_at", "2015-04-02 17:37:52.575650"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:37:52.577520"], ["updated_at", "2015-04-02 17:37:52.577520"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:37:52.580037"], ["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.7ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.583112"], ["updated_at", "2015-04-02 17:37:52.583112"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.587854"], ["updated_at", "2015-04-02 17:37:52.587854"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.591637"], ["updated_at", "2015-04-02 17:37:52.591637"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.594048"], ["updated_at", "2015-04-02 17:37:52.594048"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.596762"], ["updated_at", "2015-04-02 17:37:52.596762"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.599040"], ["updated_at", "2015-04-02 17:37:52.599040"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:37:52.601939"], ["updated_at", "2015-04-02 17:37:52.601939"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.604612"], ["updated_at", "2015-04-02 17:37:52.604612"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:37:52.609705"], ["updated_at", "2015-04-02 17:37:52.609705"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428082672"], ["created_at", "2015-04-02 17:37:52.617397"], ["updated_at", "2015-04-02 17:37:52.617397"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token still valid (17) [refresh_token] Token requested (17)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427909872"], ["created_at", "2015-04-02 17:37:52.621140"], ["updated_at", "2015-04-02 17:37:52.621140"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428169072"], ["updated_at", "2015-04-02 17:37:52.632618"], ["id", 18]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427909872"], ["created_at", "2015-04-02 17:37:52.636314"], ["updated_at", "2015-04-02 17:37:52.636314"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428169072"], ["updated_at", "2015-04-02 17:37:52.639052"], ["id", 19]]  (0.3ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.646231"], ["updated_at", "2015-04-02 17:37:52.646231"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.652885"], ["updated_at", "2015-04-02 17:37:52.652885"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:37:52.658473"], ["updated_at", "2015-04-02 17:37:52.658473"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.6ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.120474"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.120474"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.127091"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.127091"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.9ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.133068"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.133068"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.140362"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.140362"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.142519"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.142519"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:38:55.145632"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.149446"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.149446"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.151064"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.151064"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:38:55.153570"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.157384"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.157384"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.159307"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.159307"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 17:38:55.161751"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.165776"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.165776"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.169577"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.169577"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.173237"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.173237"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.175690"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.175690"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.178685"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.178685"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.181017"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.181017"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 17:38:55.183641"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 17:38:55.183641"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 17:38:55.185800"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.185800"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:38:55.188582"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082735], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.188582"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token still valid (18) [refresh_token] Token requested (18)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:38:55.192033"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909935"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:38:55.192033"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169135"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:38:55.200594"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:38:58.139334"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909935"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:38:58.139334"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169142"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:39:02.850754"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20) Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 [refresh_token] Token requested (20)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 17:39:40.059732"], ["uid", 0], ["updated_at", "2015-04-02 17:39:40.059732"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:39:40.067497"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 17:39:40.067497"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 17:39:40.069570"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 17:39:43.390506"], ["updated_at", "2015-04-02 17:39:43.390506"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.7ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428082783"], ["created_at", "2015-04-02 17:39:43.403074"], ["updated_at", "2015-04-02 17:39:43.403074"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427909983"], ["created_at", "2015-04-02 17:39:43.407150"], ["updated_at", "2015-04-02 17:39:43.407150"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428169183"], ["updated_at", "2015-04-02 17:39:43.420468"], ["id", 3]]  (0.3ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427909983"], ["created_at", "2015-04-02 17:39:45.041143"], ["updated_at", "2015-04-02 17:39:45.041143"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428169185"], ["updated_at", "2015-04-02 17:39:45.044897"], ["id", 4]]  (0.2ms) COMMIT [refresh_token] Token update successful (4)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 17:39:45.048757"], ["updated_at", "2015-04-02 17:39:45.048757"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 17:39:45.051235"], ["id", 5]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.055922"], ["updated_at", "2015-04-02 17:39:45.055922"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:39:45.058140"], ["updated_at", "2015-04-02 17:39:45.058140"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:39:45.061527"], ["id", 7]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.065601"], ["updated_at", "2015-04-02 17:39:45.065601"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:39:45.067284"], ["updated_at", "2015-04-02 17:39:45.067284"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:39:45.070627"], ["id", 9]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.074378"], ["updated_at", "2015-04-02 17:39:45.074378"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 17:39:45.076347"], ["updated_at", "2015-04-02 17:39:45.076347"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 17:39:45.079019"], ["id", 11]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.083048"], ["updated_at", "2015-04-02 17:39:45.083048"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.087405"], ["updated_at", "2015-04-02 17:39:45.087405"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.091079"], ["updated_at", "2015-04-02 17:39:45.091079"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.093623"], ["updated_at", "2015-04-02 17:39:45.093623"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.096744"], ["updated_at", "2015-04-02 17:39:45.096744"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.099273"], ["updated_at", "2015-04-02 17:39:45.099273"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 17:39:45.102597"], ["updated_at", "2015-04-02 17:39:45.102597"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.105197"], ["updated_at", "2015-04-02 17:39:45.105197"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.120365"], ["updated_at", "2015-04-02 17:39:45.120365"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.126025"], ["updated_at", "2015-04-02 17:39:45.126025"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 17:39:45.131720"], ["updated_at", "2015-04-02 17:39:45.131720"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:39:50.936570"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428082790], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:39:50.936570"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:39:50.945673"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909990"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:39:50.945673"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169190"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:39:50.955163"]]  (0.1ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 17:39:53.411156"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427909990"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 17:39:53.411156"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428169217"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 17:40:17.218724"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3) [refresh_token] Token requested (3) Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 [refresh_token] Token requested (3)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:40:25.424342"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:40:25.424342"]]  (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"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:40:25.426336"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.5ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:40:25.436263"], ["uid", 0], ["updated_at", "2015-04-02 19:40:25.436263"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.443685"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.443685"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.445750"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.445750"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (1.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:25.451052"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.454978"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.454978"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.456992"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.456992"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:25.460571"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.464117"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.464117"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.465788"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.465788"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:25.468277"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.472564"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.472564"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.476582"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.476582"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.480355"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.480355"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.482558"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.482558"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.485674"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.485674"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.488093"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.488093"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:25.490826"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:25.490826"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.493170"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.493170"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (1.4ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.526373"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.526373"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.530906"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.530906"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:25.535179"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:25.535179"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.836415"], ["updated_at", "2015-04-02 19:40:28.836415"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.843265"], ["updated_at", "2015-04-02 19:40:28.843265"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.850763"], ["updated_at", "2015-04-02 19:40:28.850763"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:40:28.854507"], ["updated_at", "2015-04-02 19:40:28.854507"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 19:40:28.857286"], ["id", 4]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.862218"], ["updated_at", "2015-04-02 19:40:28.862218"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.866442"], ["updated_at", "2015-04-02 19:40:28.866442"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.869629"], ["updated_at", "2015-04-02 19:40:28.869629"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.872204"], ["updated_at", "2015-04-02 19:40:28.872204"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.875500"], ["updated_at", "2015-04-02 19:40:28.875500"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.9ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.878100"], ["updated_at", "2015-04-02 19:40:28.878100"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.882957"], ["updated_at", "2015-04-02 19:40:28.882957"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:28.885458"], ["updated_at", "2015-04-02 19:40:28.885458"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.888220"], ["updated_at", "2015-04-02 19:40:28.888220"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:40:28.890139"], ["updated_at", "2015-04-02 19:40:28.890139"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:40:28.892701"], ["id", 14]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.895758"], ["updated_at", "2015-04-02 19:40:28.895758"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:40:28.897586"], ["updated_at", "2015-04-02 19:40:28.897586"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:40:28.899934"], ["id", 16]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:28.902965"], ["updated_at", "2015-04-02 19:40:28.902965"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:40:28.904637"], ["updated_at", "2015-04-02 19:40:28.904637"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:40:28.907067"], ["id", 18]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427917228"], ["created_at", "2015-04-02 19:40:28.911535"], ["updated_at", "2015-04-02 19:40:28.911535"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428176428"], ["updated_at", "2015-04-02 19:40:28.922993"], ["id", 19]]  (0.2ms) COMMIT [refresh_token] Token update successful (19)  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427917229"], ["created_at", "2015-04-02 19:40:29.928535"], ["updated_at", "2015-04-02 19:40:29.928535"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428176429"], ["updated_at", "2015-04-02 19:40:29.931655"], ["id", 20]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428090029"], ["created_at", "2015-04-02 19:40:29.934953"], ["updated_at", "2015-04-02 19:40:29.934953"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 19:40:29.941117"], ["updated_at", "2015-04-02 19:40:29.941117"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.690894"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.690894"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.697556"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.697556"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.702725"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.702725"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:40:38.725763"], ["uid", 0], ["updated_at", "2015-04-02 19:40:38.725763"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.734098"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.734098"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.736281"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.736281"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:38.739362"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.742904"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.742904"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.744700"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.744700"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 8 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:38.746953"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.750521"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.750521"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.752312"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.752312"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:40:38.754580"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.758257"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.758257"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.761722"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.761722"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.766186"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.766186"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.768867"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.768867"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.771646"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.771646"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.773706"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.773706"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:38.776138"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:38.776138"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:38.778265"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.778265"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:40:38.781038"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090038], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.781038"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token still valid (19) [refresh_token] Token requested (19)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:40:38.784245"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917238"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.784245"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176438"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:40:38.792191"]]  (0.3ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:40:38.799035"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917238"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:40:38.799035"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176438"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:40:38.801902"]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (1.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:40:39.807879"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:40:39.807879"]]  (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"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:40:39.809947"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.130775"], ["updated_at", "2015-04-02 19:40:43.130775"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 4.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.138422"], ["updated_at", "2015-04-02 19:40:43.138422"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.144370"], ["updated_at", "2015-04-02 19:40:43.144370"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 4ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.172381"], ["updated_at", "2015-04-02 19:40:43.172381"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:40:43.174939"], ["updated_at", "2015-04-02 19:40:43.174939"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:40:43.178687"], ["id", 5]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.182502"], ["updated_at", "2015-04-02 19:40:43.182502"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:40:43.184714"], ["updated_at", "2015-04-02 19:40:43.184714"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:40:43.187891"], ["id", 7]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.193031"], ["updated_at", "2015-04-02 19:40:43.193031"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:40:43.195278"], ["updated_at", "2015-04-02 19:40:43.195278"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:40:43.198309"], ["id", 9]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.201833"], ["updated_at", "2015-04-02 19:40:43.201833"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.205974"], ["updated_at", "2015-04-02 19:40:43.205974"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.209718"], ["updated_at", "2015-04-02 19:40:43.209718"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.212262"], ["updated_at", "2015-04-02 19:40:43.212262"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.215042"], ["updated_at", "2015-04-02 19:40:43.215042"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.218032"], ["updated_at", "2015-04-02 19:40:43.218032"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:40:43.221173"], ["updated_at", "2015-04-02 19:40:43.221173"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:40:43.223767"], ["updated_at", "2015-04-02 19:40:43.223767"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 19:40:43.230587"], ["updated_at", "2015-04-02 19:40:43.230587"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428090043"], ["created_at", "2015-04-02 19:40:43.238250"], ["updated_at", "2015-04-02 19:40:43.238250"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token still valid (19) [refresh_token] Token requested (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427917243"], ["created_at", "2015-04-02 19:40:43.242527"], ["updated_at", "2015-04-02 19:40:43.242527"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428176443"], ["updated_at", "2015-04-02 19:40:43.253801"], ["id", 20]]  (0.1ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427917243"], ["created_at", "2015-04-02 19:40:43.257885"], ["updated_at", "2015-04-02 19:40:43.257885"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428176443"], ["updated_at", "2015-04-02 19:40:43.260655"], ["id", 21]]  (0.1ms) COMMIT [refresh_token] Token update successful (21)  (0.5ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:40:44.268395"], ["updated_at", "2015-04-02 19:40:44.268395"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 19:40:44.270794"], ["id", 22]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.331278"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.331278"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.337915"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.337915"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.342808"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.342808"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:40:55.350847"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:40:55.350847"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:40:55.353241"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.357138"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.357138"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.361130"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.361130"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.364403"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.364403"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.366823"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.366823"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.369756"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.369756"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.372191"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.372191"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.374915"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.374915"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:40:55.377224"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.377224"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.380143"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.380143"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.381864"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.381864"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:55.384100"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.387164"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.387164"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.388796"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.388796"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:55.390828"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.394346"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:40:55.394346"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:40:55.396267"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.396267"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:40:55.398704"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:40:55.402846"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917255"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:40:55.402846"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176455"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:40:55.410891"]]  (0.1ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:40:56.418536"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917256"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:40:56.418536"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176456"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:40:56.421828"]]  (0.1ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:40:56.424836"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090056], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:40:56.424836"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:40:56.429702"], ["uid", 0], ["updated_at", "2015-04-02 19:40:56.429702"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:42:38.830070"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:42:38.830070"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:42:38.836786"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:42:38.836786"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:42:38.842076"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:42:38.842076"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:42:38.870958"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917358"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:42:38.870958"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176558"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:42:38.880564"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "updated_at" = $2 WHERE "accounts"."id" = 4 [["oauth_access_token", "t"], ["updated_at", "2015-04-02 19:42:59.448824"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176558"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:44:43.361590"]]  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:45:34.441171"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917534"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.441171"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176734"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:45:34.444174"]]  (0.2ms) COMMIT [refresh_token] Token update successful (5)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:45:34.447756"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090334], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.447756"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (6) [refresh_token] Token still valid (6) [refresh_token] Token requested (6)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.452584"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.452584"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:34.456700"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.456700"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.460633"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.460633"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:34.463098"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.463098"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.466007"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.466007"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:34.469364"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.469364"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.472265"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.472265"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:34.474639"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.474639"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.477760"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.477760"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.479601"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.479601"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:45:34.482046"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.485348"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.485348"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.487176"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.487176"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:45:34.489588"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.493076"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:45:34.493076"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:45:34.495015"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:34.495015"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 20 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:45:34.497406"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.7ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:45:34.504626"], ["uid", 0], ["updated_at", "2015-04-02 19:45:34.504626"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:45:34.512264"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:45:34.512264"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:45:34.514426"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:39.515225"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:39.515225"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 5.7ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:39.523093"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:39.523093"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:45:39.527573"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:45:39.527573"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:45:39.541988"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917539"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:45:39.541988"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176739"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:45:39.553558"]]  (0.2ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 [refresh_token] Token update successful (4) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:46:46.649313"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917606"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:46:46.649313"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176806"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:46:46.652059"]]  (0.1ms) COMMIT [refresh_token] Token update successful (5)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:46:47.752623"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090407], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.752623"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (6) [refresh_token] Token still valid (6) [refresh_token] Token requested (6)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:46:47.755714"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:46:47.755714"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 7 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:46:47.757549"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:46:47.763466"], ["uid", 0], ["updated_at", "2015-04-02 19:46:47.763466"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.773506"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.773506"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:46:47.777964"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.777964"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.781740"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.781740"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:46:47.784482"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.784482"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.787444"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.787444"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:46:47.789565"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.789565"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.792209"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.792209"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:46:47.794462"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.794462"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.797353"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.797353"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.798923"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.798923"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:46:47.801023"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.804047"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.804047"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.805600"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.805600"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 20 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:46:47.807824"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.811450"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:46:47.811450"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:46:47.813240"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:46:47.813240"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 22) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 22 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:46:47.815655"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 19:47:06.069836"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:47:06.069836"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:47:06.073607"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:47:06.080820"], ["uid", 0], ["updated_at", "2015-04-02 19:47:06.080820"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:47:06.088906"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090426], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:47:06.088906"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:47:06.091857"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917626"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:47:06.091857"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176826"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:47:06.101389"]]  (0.1ms) COMMIT [refresh_token] Token update successful (4)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:47:06.106656"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917626"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:47:06.106656"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176826"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:47:06.109575"]]  (0.2ms) COMMIT [refresh_token] Token update successful (5) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.656756"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.656756"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.658714"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.658714"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:47:12.662346"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.665996"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.665996"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.667570"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.667570"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:47:12.670215"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.673811"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.673811"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.675587"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.675587"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:47:12.677902"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.681106"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.681106"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.686239"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.686239"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.689803"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.689803"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.692034"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.692034"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.695013"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.695013"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.697439"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.697439"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:47:12.700202"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:47:12.700202"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.702487"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.702487"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.730255"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.730255"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.734959"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.734959"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:47:12.739364"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:47:12.739364"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:20.991635"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:20.991635"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:20.997923"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:20.997923"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:21.003360"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.003360"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.006745"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.006745"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (1.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:21.011846"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.011846"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.015042"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.015042"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:21.017496"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.017496"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.020781"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.020781"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:21.023183"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.023183"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.026014"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.026014"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:48:21.028535"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.028535"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.031380"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.031380"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.033238"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.033238"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:48:21.036145"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.039509"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.039509"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.041539"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.041539"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:48:21.044040"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.047892"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:48:21.047892"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:48:21.049357"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.049357"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:48:21.051480"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:48:21.055122"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:48:21.055122"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:48:21.056959"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:48:21.060236"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917701"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:48:21.060236"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (1.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176901"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:48:21.068945"]]  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update successful (19) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:48:44.431267"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917724"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:48:44.431267"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428176924"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:48:44.434207"]]  (0.3ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (1.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:50:11.736295"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090611], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:50:11.736295"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:50:11.741836"], ["uid", 0], ["updated_at", "2015-04-02 19:50:11.741836"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:50:47.231698"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917847"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:50:47.231698"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177047"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:50:47.247073"]]  (0.2ms) COMMIT Account Load (0.5ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update successful (1) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.8ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:51:25.929858"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917885"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:51:25.929858"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177085"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:51:25.933122"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:51:43.152705"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090703], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.152705"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:51:43.160229"], ["uid", 0], ["updated_at", "2015-04-02 19:51:43.160229"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.167440"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.167440"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.173179"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.173179"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.177319"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.177319"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.180273"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.180273"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.183575"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.183575"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.185854"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.185854"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.189011"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.189011"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.191538"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.191538"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.194599"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.194599"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.196367"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.196367"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:51:43.198615"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.201818"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.201818"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.203541"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.203541"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:51:43.205945"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.209979"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:51:43.209979"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:51:43.212055"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.212055"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:51:43.214821"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:51:43.219111"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:51:43.219111"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:51:43.221135"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.252311"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.252311"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.257209"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.257209"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:51:43.262956"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:51:43.262956"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 2.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 19:52:08.260028"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:52:08.260028"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:52:08.262767"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.267672"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.267672"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.269472"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.269472"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 3 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:52:08.273546"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.277462"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.277462"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.279145"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.279145"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:52:08.281353"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.284971"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.284971"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.9ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.286728"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.286728"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:52:08.289945"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.293326"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.293326"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:08.297318"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.297318"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.300587"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.300587"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:08.302758"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.302758"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.305714"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.305714"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:08.308239"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.308239"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:52:08.310993"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:52:08.310993"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:08.313382"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.313382"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:52:08.318268"], ["uid", 0], ["updated_at", "2015-04-02 19:52:08.318268"]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:52:08.326418"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090728], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.326418"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token still valid (17) [refresh_token] Token requested (17)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:52:08.331239"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917928"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:52:08.331239"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177128"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:52:08.343033"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:52:23.993407"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427917943"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:52:23.993407"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177143"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:52:23.996868"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:33.627367"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:33.627367"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:33.632709"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:33.632709"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:52:33.637552"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:52:33.637552"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:54:19.712147"], ["uid", 0], ["updated_at", "2015-04-02 19:54:19.712147"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:54:19.726322"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918059"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:54:19.726322"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177259"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:54:19.739789"]]  (0.2ms) COMMIT  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1  (0.3ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update successful (2) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:55:32.633709"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918132"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:55:32.633709"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177332"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:55:32.637162"]]  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:55:45.463931"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428090945], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.463931"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token still valid (4) [refresh_token] Token requested (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:55:45.467357"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:55:45.467357"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:55:45.469175"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.472989"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.472989"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.478369"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.478369"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.482105"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.482105"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.484828"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.484828"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.488061"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.488061"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.490126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.490126"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.494011"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.494011"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.496792"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.496792"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.499757"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.499757"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.501499"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.501499"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:55:45.503724"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.507257"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.507257"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.508901"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.508901"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:55:45.510932"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.514556"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:55:45.514556"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:55:45.516763"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.516763"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 19 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:55:45.519140"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.542693"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.542693"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.547614"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.547614"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:55:45.552598"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:55:45.552598"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:55:51.607538"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918151"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:55:51.607538"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177351"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:55:51.618312"]]  (0.2ms) COMMIT [refresh_token] Token update successful (1) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]] Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177351"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:58:01.345755"]]  (0.2ms) COMMIT Account Load (0.3ms) SELECT "accounts".* FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:59:12.529443"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918352"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:59:12.529443"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177552"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:59:12.537898"]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:59:13.569285"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428091153], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.569285"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 19:59:13.572407"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:59:13.572407"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:59:13.574375"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.577883"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.577883"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.583052"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.583052"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.587335"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.587335"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.589789"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.589789"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.592654"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.592654"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.595126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.595126"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.598887"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.598887"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.601598"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.601598"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.604658"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.604658"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.606223"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.606223"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:59:13.608721"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.612418"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.612418"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.614268"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.614268"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:59:13.616587"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.619810"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:13.619810"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:13.621510"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.621510"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:59:13.623628"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 19:59:13.629219"], ["uid", 0], ["updated_at", "2015-04-02 19:59:13.629219"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.650427"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.650427"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.654914"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.654914"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:13.660255"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:13.660255"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:16.976474"], ["updated_at", "2015-04-02 19:59:16.976474"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.8ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:16.983177"], ["updated_at", "2015-04-02 19:59:16.983177"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:16.989516"], ["updated_at", "2015-04-02 19:59:16.989516"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 2.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 19:59:17.015247"], ["updated_at", "2015-04-02 19:59:17.015247"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.024183"], ["updated_at", "2015-04-02 19:59:17.024183"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:59:17.026542"], ["updated_at", "2015-04-02 19:59:17.026542"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:59:17.030129"], ["id", 6]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.034169"], ["updated_at", "2015-04-02 19:59:17.034169"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:59:17.036144"], ["updated_at", "2015-04-02 19:59:17.036144"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:59:17.038820"], ["id", 8]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.042718"], ["updated_at", "2015-04-02 19:59:17.042718"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 19:59:17.044710"], ["updated_at", "2015-04-02 19:59:17.044710"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 19:59:17.047195"], ["id", 10]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.050237"], ["updated_at", "2015-04-02 19:59:17.050237"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:17.054439"], ["updated_at", "2015-04-02 19:59:17.054439"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.058500"], ["updated_at", "2015-04-02 19:59:17.058500"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:17.061113"], ["updated_at", "2015-04-02 19:59:17.061113"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.063827"], ["updated_at", "2015-04-02 19:59:17.063827"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:17.066289"], ["updated_at", "2015-04-02 19:59:17.066289"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 19:59:17.069049"], ["updated_at", "2015-04-02 19:59:17.069049"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 19:59:17.071317"], ["updated_at", "2015-04-02 19:59:17.071317"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428091157"], ["created_at", "2015-04-02 19:59:17.074253"], ["updated_at", "2015-04-02 19:59:17.074253"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token still valid (19) [refresh_token] Token requested (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427918357"], ["created_at", "2015-04-02 19:59:17.077769"], ["updated_at", "2015-04-02 19:59:17.077769"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428177557"], ["updated_at", "2015-04-02 19:59:17.091641"], ["id", 20]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427918359"], ["created_at", "2015-04-02 19:59:19.969689"], ["updated_at", "2015-04-02 19:59:19.969689"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428177559"], ["updated_at", "2015-04-02 19:59:19.973055"], ["id", 21]]  (0.2ms) COMMIT [refresh_token] Token update successful (21) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:59:24.524351"], ["updated_at", "2015-04-02 19:59:24.524351"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 19:59:24.526605"], ["id", 22]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.889433"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.889433"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.6ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.896543"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.896543"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.901429"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.901429"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.7ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 19:59:42.909613"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 19:59:42.909613"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 19:59:42.912135"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.916486"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.916486"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.920869"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.920869"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.924350"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.924350"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.926525"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.926525"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.928839"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.928839"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.931195"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.931195"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.934060"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.934060"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 19:59:42.936561"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.936561"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.939388"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.939388"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.941116"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.941116"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:59:42.943368"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.946644"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.946644"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.948216"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.948216"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:59:42.950209"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.953434"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 19:59:42.953434"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 19:59:42.954931"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.954931"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 19:59:42.957028"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 19:59:42.960415"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918382"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 19:59:42.960415"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.3ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177582"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 19:59:42.969245"]]  (0.2ms) COMMIT [refresh_token] Token update successful (19) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.6ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177582"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:01:42.265380"]]  (0.1ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:02:07.480877"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918527"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:02:07.480877"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177727"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:02:07.484043"]]  (0.2ms) COMMIT [refresh_token] Token update successful (20)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:02:07.487409"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428091327], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:02:07.487409"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (1.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:02:07.493146"], ["uid", 0], ["updated_at", "2015-04-02 20:02:07.493146"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.285967"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.285967"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.292882"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.292882"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.297478"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.297478"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 2.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 20:02:12.316996"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:02:12.316996"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 20:02:12.319418"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.323891"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.323891"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.328476"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.328476"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.331948"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.331948"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.334615"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.334615"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.337819"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.337819"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.340317"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.340317"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.342940"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.342940"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:02:12.345103"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.345103"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.347897"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.347897"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.349628"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.349628"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:02:12.351736"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.354539"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.354539"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.356094"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.356094"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:02:12.358281"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.361033"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:02:12.361033"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:02:12.362580"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.362580"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:02:12.364616"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:02:12.370447"], ["uid", 0], ["updated_at", "2015-04-02 20:02:12.370447"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:02:12.380866"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918532"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:02:12.380866"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177739"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:02:19.992211"]]  (0.1ms) COMMIT [refresh_token] Token update successful (20) Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:03:01.241124"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918581"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:03:01.241124"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428177781"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:03:01.244167"]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:03:01.247457"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428091381], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:03:01.247457"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 20:03:04.531288"], ["updated_at", "2015-04-02 20:03:04.531288"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428091384"], ["created_at", "2015-04-02 20:03:04.544141"], ["updated_at", "2015-04-02 20:03:04.544141"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427918584"], ["created_at", "2015-04-02 20:03:04.547391"], ["updated_at", "2015-04-02 20:03:04.547391"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428177784"], ["updated_at", "2015-04-02 20:03:04.559710"], ["id", 3]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427918584"], ["created_at", "2015-04-02 20:03:04.566283"], ["updated_at", "2015-04-02 20:03:04.566283"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.842006"], ["updated_at", "2015-04-02 20:03:05.842006"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.7ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:03:05.844727"], ["updated_at", "2015-04-02 20:03:05.844727"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:03:05.851209"], ["id", 6]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.855228"], ["updated_at", "2015-04-02 20:03:05.855228"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:03:05.857462"], ["updated_at", "2015-04-02 20:03:05.857462"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:03:05.860830"], ["id", 8]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.866260"], ["updated_at", "2015-04-02 20:03:05.866260"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:03:05.868434"], ["updated_at", "2015-04-02 20:03:05.868434"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:03:05.872071"], ["id", 10]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.875827"], ["updated_at", "2015-04-02 20:03:05.875827"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.880262"], ["updated_at", "2015-04-02 20:03:05.880262"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.884432"], ["updated_at", "2015-04-02 20:03:05.884432"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.887139"], ["updated_at", "2015-04-02 20:03:05.887139"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.890484"], ["updated_at", "2015-04-02 20:03:05.890484"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.893213"], ["updated_at", "2015-04-02 20:03:05.893213"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:03:05.896243"], ["updated_at", "2015-04-02 20:03:05.896243"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.898477"], ["updated_at", "2015-04-02 20:03:05.898477"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:03:05.901843"], ["updated_at", "2015-04-02 20:03:05.901843"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 20:03:05.904129"], ["id", 19]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.935525"], ["updated_at", "2015-04-02 20:03:05.935525"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.941621"], ["updated_at", "2015-04-02 20:03:05.941621"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:03:05.947498"], ["updated_at", "2015-04-02 20:03:05.947498"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:03:18.364108"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:03:18.364108"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.9ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:03:18.370473"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:03:18.370473"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:03:18.375199"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:03:18.375199"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:03:18.401180"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918598"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:03:18.401180"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1428177803"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:03:24.000783"]]  (0.1ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:08:42.585881"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918922"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.585881"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178122"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:08:42.595294"]]  (0.2ms) COMMIT [refresh_token] Token update successful (5)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:08:42.602149"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428091722], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.602149"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (6) [refresh_token] Token still valid (6) [refresh_token] Token requested (6)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.605257"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.605257"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:08:42.609251"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.609251"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.613022"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.613022"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:08:42.615283"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.615283"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.618454"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.618454"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:08:42.620830"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.620830"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.623413"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.623413"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:08:42.625707"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.625707"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.628791"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.628791"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.630621"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.630621"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:08:42.633004"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.636335"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.636335"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.638018"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.638018"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:08:42.640767"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.644748"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:08:42.644748"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:08:42.646325"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:08:42.646325"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 20 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:08:42.648669"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:08:42.652537"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:08:42.652537"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 20:08:42.654447"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 21]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:08:42.660235"], ["uid", 0], ["updated_at", "2015-04-02 20:08:42.660235"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN 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.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428091725"], ["created_at", "2015-04-02 20:08:45.974407"], ["updated_at", "2015-04-02 20:08:45.974407"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427918925"], ["created_at", "2015-04-02 20:08:45.979821"], ["updated_at", "2015-04-02 20:08:45.979821"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428178125"], ["updated_at", "2015-04-02 20:08:45.992574"], ["id", 2]]  (0.2ms) COMMIT [refresh_token] Token update successful (2)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427918934"], ["created_at", "2015-04-02 20:08:54.994053"], ["updated_at", "2015-04-02 20:08:54.994053"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 20:08:58.363703"], ["updated_at", "2015-04-02 20:08:58.363703"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-04-02 20:08:58.372800"], ["updated_at", "2015-04-02 20:08:58.372800"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 20:08:58.375145"], ["id", 5]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.380127"], ["updated_at", "2015-04-02 20:08:58.380127"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:08:58.382191"], ["updated_at", "2015-04-02 20:08:58.382191"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:08:58.386825"], ["id", 7]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.391021"], ["updated_at", "2015-04-02 20:08:58.391021"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:08:58.393456"], ["updated_at", "2015-04-02 20:08:58.393456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:08:58.396440"], ["id", 9]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.400231"], ["updated_at", "2015-04-02 20:08:58.400231"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:08:58.402079"], ["updated_at", "2015-04-02 20:08:58.402079"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:08:58.405113"], ["id", 11]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.408693"], ["updated_at", "2015-04-02 20:08:58.408693"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.412766"], ["updated_at", "2015-04-02 20:08:58.412766"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.416652"], ["updated_at", "2015-04-02 20:08:58.416652"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.419435"], ["updated_at", "2015-04-02 20:08:58.419435"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.422833"], ["updated_at", "2015-04-02 20:08:58.422833"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.425481"], ["updated_at", "2015-04-02 20:08:58.425481"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:08:58.428699"], ["updated_at", "2015-04-02 20:08:58.428699"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.431219"], ["updated_at", "2015-04-02 20:08:58.431219"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.447130"], ["updated_at", "2015-04-02 20:08:58.447130"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.5ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.454745"], ["updated_at", "2015-04-02 20:08:58.454745"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:08:58.460801"], ["updated_at", "2015-04-02 20:08:58.460801"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:09:12.093801"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428091752], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:09:12.093801"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:09:12.100864"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427918952"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:09:12.100864"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178152"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:09:12.114220"]]  (0.2ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2015-04-02 20:12:24.577798"], ["updated_at", "2015-04-02 20:12:24.577798"]]  (0.9ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1  (0.2ms) COMMIT Account Load (1.5ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:13:58.785913"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919238"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:13:58.785913"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178438"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:13:58.788997"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4)  (0.3ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.494742"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.494742"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.497025"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.497025"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:14:00.501145"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.505051"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.505051"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.506663"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.506663"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 8 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:14:00.509619"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.514078"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.514078"]]  (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"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.515727"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.515727"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:14:00.518287"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.521808"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.521808"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.525652"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.525652"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.529225"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.529225"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.531515"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.531515"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.534216"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.534216"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.536585"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.536585"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:00.539296"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:00.539296"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.542626"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.542626"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.569239"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.569239"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.574742"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.574742"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:00.579340"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:00.579340"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.9ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:14:11.819070"], ["uid", 0], ["updated_at", "2015-04-02 20:14:11.819070"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:14:11.833051"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:14:11.833051"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 20:14:11.835647"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:14:11.847050"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092051], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.847050"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:14:11.850155"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919251"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.850155"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178451"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:14:11.859659"]]  (0.2ms) COMMIT [refresh_token] Token update successful (4)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:14:11.864909"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919251"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.864909"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178451"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:14:11.867524"]]  (0.1ms) COMMIT [refresh_token] Token update successful (5)  (0.3ms) ROLLBACK  (1.6ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.872576"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.872576"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.874596"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.874596"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:14:11.878480"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.881860"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.881860"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.883822"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.883822"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:14:11.886258"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.890499"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.890499"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.892647"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.892647"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:14:11.894814"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.898221"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.898221"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.902526"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.902526"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.905980"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.905980"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.908190"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.908190"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.910953"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.910953"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.913049"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.913049"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:14:11.915531"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:14:11.915531"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.917778"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.917778"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.928653"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.928653"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 2.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.934028"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.934028"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:14:11.938452"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:14:11.938452"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.235846"], ["updated_at", "2015-04-02 20:14:15.235846"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 6.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.243356"], ["updated_at", "2015-04-02 20:14:15.243356"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.249287"], ["updated_at", "2015-04-02 20:14:15.249287"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.275459"], ["updated_at", "2015-04-02 20:14:15.275459"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:14:15.277877"], ["updated_at", "2015-04-02 20:14:15.277877"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:14:15.281178"], ["id", 5]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.284774"], ["updated_at", "2015-04-02 20:14:15.284774"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:14:15.286668"], ["updated_at", "2015-04-02 20:14:15.286668"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:14:15.289320"], ["id", 7]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.294835"], ["updated_at", "2015-04-02 20:14:15.294835"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:14:15.296982"], ["updated_at", "2015-04-02 20:14:15.296982"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:14:15.299647"], ["id", 9]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.303405"], ["updated_at", "2015-04-02 20:14:15.303405"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.307728"], ["updated_at", "2015-04-02 20:14:15.307728"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.311438"], ["updated_at", "2015-04-02 20:14:15.311438"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.313992"], ["updated_at", "2015-04-02 20:14:15.313992"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.317030"], ["updated_at", "2015-04-02 20:14:15.317030"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.319819"], ["updated_at", "2015-04-02 20:14:15.319819"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:14:15.322929"], ["updated_at", "2015-04-02 20:14:15.322929"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:14:15.325546"], ["updated_at", "2015-04-02 20:14:15.325546"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:14:15.328766"], ["updated_at", "2015-04-02 20:14:15.328766"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 20:14:15.330883"], ["id", 18]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 20:14:15.336241"], ["updated_at", "2015-04-02 20:14:15.336241"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428092055"], ["created_at", "2015-04-02 20:14:15.347527"], ["updated_at", "2015-04-02 20:14:15.347527"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token still valid (20) [refresh_token] Token requested (20)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427919255"], ["created_at", "2015-04-02 20:14:15.351214"], ["updated_at", "2015-04-02 20:14:15.351214"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428178455"], ["updated_at", "2015-04-02 20:14:15.363055"], ["id", 21]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427919255"], ["created_at", "2015-04-02 20:14:15.366860"], ["updated_at", "2015-04-02 20:14:15.366860"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token expired, requesting a refresh... (22) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (22)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428178455"], ["updated_at", "2015-04-02 20:14:15.369845"], ["id", 22]]  (0.2ms) COMMIT [refresh_token] Token update successful (22)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.4ms) 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", "2015-04-02 20:18:57.235254"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:18:57.235254"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 20:18:57.238240"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:18:57.251203"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092337], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.251203"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token still valid (2) [refresh_token] Token requested (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:18:57.255159"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919537"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.255159"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178737"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:18:57.264212"]]  (0.2ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:18:57.270207"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919537"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.270207"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1428178737"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:18:57.273046"]]  (0.1ms) COMMIT [refresh_token] Token update successful (4)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:18:57.278428"], ["uid", 0], ["updated_at", "2015-04-02 20:18:57.278428"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.285546"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.285546"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.287621"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.287621"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:18:57.291806"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.295542"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.295542"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.297579"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.297579"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 9 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:18:57.300079"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.303684"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.303684"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.305163"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.305163"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 11 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:18:57.307523"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.311521"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.311521"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.315471"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.315471"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.319123"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.319123"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.321544"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.321544"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.324667"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.324667"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.326918"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.326918"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:18:57.329621"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:18:57.329621"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.332009"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.332009"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.358822"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.358822"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.363412"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.363412"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:18:57.368097"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:18:57.368097"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.5ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.870667"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.870667"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.877887"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.877887"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.882862"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.882862"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.913963"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.913963"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.918305"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.918305"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.922302"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.922302"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.924638"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.924638"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.927544"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.927544"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.930148"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.930148"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.933088"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.933088"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:15.935343"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.935343"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.938184"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.938184"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.940475"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.940475"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 13 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:19:15.943164"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.946762"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.946762"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.948491"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.948491"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 15 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:19:15.950738"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.954108"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:15.954108"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:15.955754"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.955754"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:19:15.957750"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-02 20:19:15.964342"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:19:15.964342"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 20:19:15.966422"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:19:15.972920"], ["uid", 0], ["updated_at", "2015-04-02 20:19:15.972920"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:19:15.979690"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919555"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.979690"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178755"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:19:15.988413"]]  (0.5ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:19:15.996127"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919555"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:19:15.996127"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 21 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178755"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:19:15.998427"]]  (0.2ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:19:16.001441"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092356], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:19:16.001441"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.766454"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.766454"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.769438"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.769438"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:19:25.774172"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.778169"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.778169"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.779883"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.779883"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:19:25.781869"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.785269"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.785269"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.786901"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.786901"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:19:25.789180"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.793006"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.793006"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.796767"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.796767"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.800565"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.800565"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.802952"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.802952"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.805854"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.805854"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.808235"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.808235"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 20:19:25.810942"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:19:25.810942"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.813043"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.813043"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 20:19:25.824770"], ["uid", 0], ["updated_at", "2015-04-02 20:19:25.824770"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:19:25.832679"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092365], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.832679"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (16) [refresh_token] Token still valid (16) [refresh_token] Token requested (16)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:19:25.836116"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919565"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.836116"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (17) [refresh_token] Token expired, requesting a refresh... (17) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (17)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 17 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178765"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:19:25.844740"]]  (0.5ms) COMMIT [refresh_token] Token update successful (17)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 20:19:25.850614"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919565"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.850614"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178765"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:19:25.853224"]]  (0.2ms) COMMIT [refresh_token] Token update successful (18)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:19:25.856333"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:19:25.856333"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 20:19:25.858298"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.869215"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.869215"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.873598"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.873598"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 20:19:25.877862"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:19:25.877862"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.185975"], ["updated_at", "2015-04-02 20:19:29.185975"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.192668"], ["updated_at", "2015-04-02 20:19:29.192668"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.198070"], ["updated_at", "2015-04-02 20:19:29.198070"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.228840"], ["updated_at", "2015-04-02 20:19:29.228840"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.234169"], ["updated_at", "2015-04-02 20:19:29.234169"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.237897"], ["updated_at", "2015-04-02 20:19:29.237897"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.240488"], ["updated_at", "2015-04-02 20:19:29.240488"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.243213"], ["updated_at", "2015-04-02 20:19:29.243213"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.245657"], ["updated_at", "2015-04-02 20:19:29.245657"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.248828"], ["updated_at", "2015-04-02 20:19:29.248828"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 20:19:29.251236"], ["updated_at", "2015-04-02 20:19:29.251236"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.254028"], ["updated_at", "2015-04-02 20:19:29.254028"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:19:29.255856"], ["updated_at", "2015-04-02 20:19:29.255856"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:19:29.258574"], ["id", 13]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.262324"], ["updated_at", "2015-04-02 20:19:29.262324"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:19:29.264259"], ["updated_at", "2015-04-02 20:19:29.264259"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:19:29.266813"], ["id", 15]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 20:19:29.271494"], ["updated_at", "2015-04-02 20:19:29.271494"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 20:19:29.273431"], ["updated_at", "2015-04-02 20:19:29.273431"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 20:19:29.275884"], ["id", 17]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 20:19:29.280098"], ["updated_at", "2015-04-02 20:19:29.280098"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 20:19:29.282229"], ["id", 18]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 20:19:29.288408"], ["updated_at", "2015-04-02 20:19:29.288408"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427919569"], ["created_at", "2015-04-02 20:19:29.297250"], ["updated_at", "2015-04-02 20:19:29.297250"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428178769"], ["updated_at", "2015-04-02 20:19:29.309521"], ["id", 20]]  (0.1ms) COMMIT [refresh_token] Token update successful (20)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427919569"], ["created_at", "2015-04-02 20:19:29.313848"], ["updated_at", "2015-04-02 20:19:29.313848"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token expired, requesting a refresh... (21) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (21)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428178769"], ["updated_at", "2015-04-02 20:19:29.316605"], ["id", 21]]  (0.1ms) COMMIT [refresh_token] Token update successful (21)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428092369"], ["created_at", "2015-04-02 20:19:29.319844"], ["updated_at", "2015-04-02 20:19:29.319844"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (22) [refresh_token] Token still valid (22) [refresh_token] Token requested (22)  (0.2ms) ROLLBACK  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.924684"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092465], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.924684"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.931035"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919665"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.931035"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178865"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:21:05.933154"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.935708"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919665"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.935708"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178865"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:21:05.937331"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:21:05.946096"], ["uid", 0], ["updated_at", "2015-04-02 20:21:05.946096"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.952343"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.952343"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.953435"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.953435"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:21:05.956094"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.958267"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.958267"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.959436"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.959436"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:21:05.960887"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.962915"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.962915"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.963925"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.963925"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:21:05.965325"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.967200"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.967200"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.970465"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.970465"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.972483"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.972483"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.973751"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.973751"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.975416"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.975416"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.976920"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.976920"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.978654"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:05.978654"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.980129"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:05.980129"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:05.981609"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:21:05.981609"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:21:05.982665"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) 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 3ms (Views: 3.2ms | 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:06.001944"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:06.001944"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:06.005446"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:06.005446"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:06.009645"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:06.009645"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:21:36.864281"], ["uid", 0], ["updated_at", "2015-04-02 20:21:36.864281"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.876060"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092496], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.876060"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.882187"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919696"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.882187"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178896"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:21:36.885378"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.888523"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427919696"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.888523"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428178896"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:21:36.890446"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.892647"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.892647"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.893829"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.893829"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:21:36.896690"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.898925"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.898925"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.900165"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.900165"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:21:36.901607"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.903666"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.903666"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.904894"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.904894"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:21:36.906373"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.908577"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.908577"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.911390"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.911390"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.913600"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.913600"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.915093"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.915093"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.916873"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.916873"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.918274"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.918274"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.920013"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:21:36.920013"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.921699"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.921699"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.926346"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:21:36.926346"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:21:36.927460"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.931715"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.931715"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.935126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.935126"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:21:36.938963"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:21:36.938963"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.548290"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.548290"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.552818"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.552818"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.556771"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.556771"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.564791"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.564791"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.568111"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.568111"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.570073"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.570073"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.571494"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.571494"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.573638"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.573638"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.575029"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.575029"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.576664"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.576664"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.578066"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.578066"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.579691"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.579691"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.580869"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.580869"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:28:09.582726"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.584755"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.584755"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.585771"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.585771"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:28:09.587119"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.589082"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:09.589082"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.590091"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.590091"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:28:09.591513"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:28:09.595444"], ["uid", 0], ["updated_at", "2015-04-02 20:28:09.595444"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.600938"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:28:09.600938"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:28:09.602044"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.604518"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920089"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.604518"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179289"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:09.606602"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.609306"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920089"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.609306"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179289"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:09.610722"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:09.612642"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092889], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:09.612642"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.462302"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.462302"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.463915"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.463915"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:28:18.468291"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.471087"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.471087"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.472148"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.472148"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:28:18.473813"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.476235"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.476235"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.477300"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.477300"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:28:18.478639"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.481156"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.481156"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.484359"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.484359"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.486541"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.486541"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.488022"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.488022"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.489683"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.489683"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.491073"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.491073"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.492808"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:18.492808"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.494242"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.494242"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.496201"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092898], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.496201"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.501834"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920098"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.501834"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179298"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:18.503547"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.506039"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920098"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.506039"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179298"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:18.507548"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.2ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:28:18.511262"], ["uid", 0], ["updated_at", "2015-04-02 20:28:18.511262"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.517229"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:28:18.517229"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:28:18.518360"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.536157"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.536157"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.539644"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.539644"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:18.543081"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:18.543081"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.498058"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.498058"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.502505"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.502505"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.505820"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.505820"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:28:33.520941"], ["uid", 0], ["updated_at", "2015-04-02 20:28:33.520941"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.526675"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920113"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.526675"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179313"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:33.529316"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.532153"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920113"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.532153"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179313"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:33.533629"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.535484"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092913], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.535484"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.540197"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.540197"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.543021"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.543021"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.545318"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.545318"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.546796"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.546796"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.548589"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.548589"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.550018"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.550018"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.551623"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.551623"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.553138"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.553138"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.554756"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.554756"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.555733"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.555733"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:28:33.557010"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.558774"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.558774"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.559758"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.559758"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:28:33.561062"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.563002"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:33.563002"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.563944"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:33.563944"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:28:33.565294"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:33.567092"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:28:33.567092"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:28:33.568318"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.365801"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.365801"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.370578"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.370578"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.374558"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.374558"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.397859"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.397859"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.400581"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.400581"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.402799"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.402799"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.404141"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.404141"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.405751"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.405751"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.407134"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.407134"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.408735"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.408735"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.410132"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.410132"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.411768"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.411768"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.413599"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.413599"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:28:46.415456"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.417600"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.417600"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.418676"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.418676"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:28:46.420039"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.421982"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:28:46.421982"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.423050"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.423050"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:28:46.424550"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.426410"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:28:46.426410"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:28:46.427510"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:28:46.434259"], ["uid", 0], ["updated_at", "2015-04-02 20:28:46.434259"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.440565"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920126"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.440565"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179326"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:46.442438"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.444658"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920126"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.444658"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179326"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:28:46.446079"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:28:46.447793"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428092926], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:28:46.447793"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:35:27.646890"], ["uid", 0], ["updated_at", "2015-04-02 20:35:27.646890"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:35:27.664447"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428093327], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:35:27.664447"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:35:27.666935"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920527"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:35:27.666935"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179727"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:35:27.669025"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:35:31.946576"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920527"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:35:31.946576"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179747"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:35:47.954817"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction [refresh_token] Token requested (1) [refresh_token] Token requested (1) [refresh_token] Token requested (1)  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.387901"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:36:36.387901"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:36:36.389190"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.391410"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.391410"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.392584"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.392584"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:36:36.395350"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.397688"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.397688"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.398690"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.398690"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:36:36.400130"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.402153"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.402153"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.403152"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.403152"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:36:36.404511"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.406494"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.406494"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.409115"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.409115"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.411340"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.411340"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.412705"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.412705"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.414408"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.414408"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.416150"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.416150"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.418228"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:36.418228"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.420388"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.420388"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.0ms) 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"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.431096"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.431096"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.435032"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.435032"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:36.438373"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:36.438373"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.3ms) 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 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.286242"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.286242"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.290861"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.290861"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.294144"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.294144"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:36:41.315291"], ["uid", 0], ["updated_at", "2015-04-02 20:36:41.315291"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.324826"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.324826"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.327695"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.327695"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.329899"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.329899"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.331393"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.331393"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.333109"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.333109"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.334470"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.334470"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.336204"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.336204"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.337664"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.337664"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.339290"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.339290"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.340427"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.340427"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:36:41.342303"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.344381"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.344381"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.345336"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.345336"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:36:41.346851"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.349061"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:36:41.349061"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:36:41.350086"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:36:41.350086"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:36:41.351460"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:36:46.018441"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920601"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:36:46.018441"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179806"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:36:46.021254"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction [refresh_token] Token requested (1)  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:02.562235"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920622"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:37:02.562235"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179822"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:37:02.564134"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:02.567120"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428093422], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:37:02.567120"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:02.568994"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:37:02.568994"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:37:02.570021"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:14.216759"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920632"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:37:14.216759"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179834"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:37:14.222226"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] [refresh_token] Token requested (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.289919"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427920678"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.289919"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428179878"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:37:58.291697"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.7ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.294559"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428093478], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.294559"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.296519"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.296519"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.300364"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.300364"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.302750"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.302750"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.304058"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.304058"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.305736"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.305736"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.307021"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.307021"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.308882"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.308882"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.310240"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.310240"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.311874"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.311874"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.312921"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.312921"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:37:58.314228"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.315822"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.315822"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.316766"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.316766"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:37:58.317980"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.319731"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:37:58.319731"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.321502"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.321502"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:37:58.322957"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.325474"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:37:58.325474"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:37:58.326545"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:37:58.332474"], ["uid", 0], ["updated_at", "2015-04-02 20:37:58.332474"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.350282"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.350282"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.353664"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.353664"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:37:58.357071"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:37:58.357071"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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: 2.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 4ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) 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 Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 0ms  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.8ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.160138"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427921302"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.160138"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428180502"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:48:22.162871"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.165933"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427921302"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.165933"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428180502"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:48:22.167398"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.169719"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428094102], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.169719"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.172234"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.172234"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.177143"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.177143"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.179288"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.179288"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.180806"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.180806"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.182429"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.182429"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.183787"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.183787"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.185750"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.185750"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.187156"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.187156"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.189134"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.189134"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.190204"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.190204"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:48:22.191683"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.193523"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.193523"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.194511"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.194511"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:48:22.195848"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.197717"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:48:22.197717"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.198756"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.198756"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:48:22.200211"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.204563"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:48:22.204563"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:48:22.205773"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:48:22.210284"], ["uid", 0], ["updated_at", "2015-04-02 20:48:22.210284"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.229296"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.229296"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.232666"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.232666"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:48:22.236997"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:48:22.236997"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:58:52.643686"], ["uid", 0], ["updated_at", "2015-04-02 20:58:52.643686"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.661764"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428094732], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.661764"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.664638"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427921932"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.664638"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181132"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:58:52.666780"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.669622"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427921932"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.669622"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181132"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:58:52.671492"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.673507"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.673507"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.674588"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.674588"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:58:52.677011"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.679107"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.679107"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.680955"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.680955"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:58:52.682385"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.684405"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.684405"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.685415"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.685415"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:58:52.686844"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.688848"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.688848"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.691642"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.691642"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.693703"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.693703"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.695223"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.695223"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.697159"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.697159"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.698590"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.698590"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.700184"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:58:52.700184"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.701567"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.701567"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.703209"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:58:52.703209"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:58:52.704301"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) 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 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.725130"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.725130"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.729218"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.729218"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.9ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:58:52.732773"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:58:52.732773"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.633999"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.633999"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.638149"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.638149"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.641379"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.641379"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 20:59:51.660072"], ["uid", 0], ["updated_at", "2015-04-02 20:59:51.660072"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.666460"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.666460"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.669398"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.669398"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.671445"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.671445"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.673060"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.673060"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.674739"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.674739"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.676953"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.676953"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.678494"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.678494"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.679896"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.679896"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.681573"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.681573"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.682558"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.682558"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 20:59:51.684155"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.686109"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.686109"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.687155"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.687155"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:59:51.688480"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.690308"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 20:59:51.690308"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.691241"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.691241"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 20:59:51.692525"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.694952"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427921991"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.694952"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181191"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:59:51.696914"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.699142"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427921991"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.699142"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181191"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 20:59:51.700587"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.702389"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428094791], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 20:59:51.702389"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 20:59:51.704101"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 20:59:51.704101"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 20:59:51.705102"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.128788"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428095146], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.128788"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.136838"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922346"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.136838"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1)  (0.1ms) begin transaction  (0.1ms) rollback transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181546"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:05:46.140273"]]  (0.0ms) commit transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.143150"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922346"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.143150"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.151849"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 21:05:46.151849"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 21:05:46.153265"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 21:05:46.157965"], ["uid", 0], ["updated_at", "2015-04-02 21:05:46.157965"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.164350"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.164350"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.165528"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.165528"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:05:46.168331"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.170425"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.170425"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.171460"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.171460"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:05:46.172934"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.174826"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.174826"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.175932"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.175932"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 21:05:46.177641"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.179713"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.179713"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.182735"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.182735"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.184913"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.184913"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.186315"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.186315"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.187906"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.187906"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.189406"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.189406"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.190929"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:05:46.190929"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.192492"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.192492"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.219996"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.219996"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.223712"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.223712"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:05:46.227158"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:05:46.227158"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.300963"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.300963"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.304827"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.304827"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.308504"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.308504"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.311558"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.311558"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.312899"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.312899"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:06:40.314826"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.316947"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.316947"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.317943"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.317943"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 21:06:40.319264"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.322358"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.322358"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.323493"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.323493"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-02 21:06:40.325028"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.327133"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.327133"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.329791"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.329791"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.331710"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.331710"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.333287"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.333287"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.334928"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.334928"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.336318"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.336318"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.337863"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:06:40.337863"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.339254"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.339254"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.341167"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 21:06:40.341167"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-02 21:06:40.342260"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.347523"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428095200], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.347523"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token still valid (1) [refresh_token] Token requested (1)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.349875"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922400"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.349875"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181600"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:06:40.351575"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-02 21:06:40.354162"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922400"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:06:40.354162"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181600"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:06:40.355736"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-02 21:06:40.360630"], ["uid", 0], ["updated_at", "2015-04-02 21:06:40.360630"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.207447"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.207447"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.213873"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.213873"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.219467"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.219467"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 21:07:29.225840"], ["uid", 0], ["updated_at", "2015-04-02 21:07:29.225840"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 21:07:29.233466"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 21:07:29.233466"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 27) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 27 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 21:07:29.236411"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 27]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.241356"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.241356"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (1.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.245807"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.245807"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.250290"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.250290"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.252455"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.252455"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.255695"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.255695"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.257999"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.257999"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.260817"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.260817"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:07:29.263129"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.263129"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.265998"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.265998"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.267741"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.267741"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 37) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 37 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:07:29.270021"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.273257"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.273257"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.274813"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.274813"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 39) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 39 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:07:29.277906"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 39]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.282112"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:07:29.282112"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:07:29.283772"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.283772"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 41) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 41 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:07:29.285941"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 41]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 21:07:29.289918"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922449"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.289918"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (42) [refresh_token] Token expired, requesting a refresh... (42) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (42)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 42) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 42 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181649"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:07:29.298462"]]  (0.2ms) COMMIT [refresh_token] Token update successful (42)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 21:07:29.303927"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922449"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.303927"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (43) [refresh_token] Token expired, requesting a refresh... (43) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (43)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 43) LIMIT 1 SQL (1.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 43 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428181649"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:07:29.306417"]]  (0.2ms) COMMIT [refresh_token] Token update successful (43)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 21:07:29.311297"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428095249], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:07:29.311297"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (44) [refresh_token] Token still valid (44) [refresh_token] Token requested (44)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427922450"], ["created_at", "2015-04-02 21:07:30.999942"], ["updated_at", "2015-04-02 21:07:30.999942"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (45) [refresh_token] Token expired, requesting a refresh... (45) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (45)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 45) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428181651"], ["updated_at", "2015-04-02 21:07:31.012782"], ["id", 45]]  (0.2ms) COMMIT [refresh_token] Token update successful (45)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427922451"], ["created_at", "2015-04-02 21:07:31.019557"], ["updated_at", "2015-04-02 21:07:31.019557"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (46) [refresh_token] Token expired, requesting a refresh... (46) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (46)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 46) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428181651"], ["updated_at", "2015-04-02 21:07:31.022470"], ["id", 46]]  (0.2ms) COMMIT [refresh_token] Token update successful (46)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428095251"], ["created_at", "2015-04-02 21:07:31.026003"], ["updated_at", "2015-04-02 21:07:31.026003"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (47) [refresh_token] Token still valid (47) [refresh_token] Token requested (47)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.029556"], ["updated_at", "2015-04-02 21:07:31.029556"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.035656"], ["updated_at", "2015-04-02 21:07:31.035656"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.039786"], ["updated_at", "2015-04-02 21:07:31.039786"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.043330"], ["updated_at", "2015-04-02 21:07:31.043330"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.046881"], ["updated_at", "2015-04-02 21:07:31.046881"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.049512"], ["updated_at", "2015-04-02 21:07:31.049512"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.053172"], ["updated_at", "2015-04-02 21:07:31.053172"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.055784"], ["updated_at", "2015-04-02 21:07:31.055784"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.058965"], ["updated_at", "2015-04-02 21:07:31.058965"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 21:07:31.061608"], ["updated_at", "2015-04-02 21:07:31.061608"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 57) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 21:07:31.066580"], ["id", 57]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.070120"], ["updated_at", "2015-04-02 21:07:31.070120"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 21:07:31.072433"], ["updated_at", "2015-04-02 21:07:31.072433"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 59) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 21:07:31.075283"], ["id", 59]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 59]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:07:31.079917"], ["updated_at", "2015-04-02 21:07:31.079917"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 21:07:31.081959"], ["updated_at", "2015-04-02 21:07:31.081959"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 61) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 21:07:31.084934"], ["id", 61]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 61]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 21:07:31.092529"], ["updated_at", "2015-04-02 21:07:31.092529"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 62) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 21:07:31.094631"], ["id", 62]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 62]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 21:07:31.100869"], ["updated_at", "2015-04-02 21:07:31.100869"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.127764"], ["updated_at", "2015-04-02 21:07:31.127764"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.134473"], ["updated_at", "2015-04-02 21:07:31.134473"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:07:31.140664"], ["updated_at", "2015-04-02 21:07:31.140664"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.022143"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.022143"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.2ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.029058"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.029058"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.034453"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.034453"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 2.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 21:13:35.055827"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-02 21:13:35.055827"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 70) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 70 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-02 21:13:35.058058"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 70]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.062328"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.062328"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.064242"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.064242"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 72) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 72 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:13:35.066654"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.069604"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.069604"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.071239"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.071239"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 74) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 74 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:13:35.073583"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 74]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.076931"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.076931"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.078659"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.078659"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 76) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 76 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-02 21:13:35.080995"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 76]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.084432"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.084432"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.088020"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.088020"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.090970"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.090970"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.093211"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.093211"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.096446"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.096446"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.098575"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.098575"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-02 21:13:35.100993"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-02 21:13:35.100993"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-02 21:13:35.102978"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.102978"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-02 21:13:35.107759"], ["uid", 0], ["updated_at", "2015-04-02 21:13:35.107759"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 21:13:35.118620"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428095615], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.118620"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (86) [refresh_token] Token still valid (86) [refresh_token] Token requested (86)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 21:13:35.122094"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922815"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.122094"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (87) [refresh_token] Token expired, requesting a refresh... (87) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (87)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 87) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 87 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428182015"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:13:35.130572"]]  (0.2ms) COMMIT [refresh_token] Token update successful (87)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-02 21:13:35.135633"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427922815"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-02 21:13:35.135633"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (88) [refresh_token] Token expired, requesting a refresh... (88) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (88)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 88) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 88 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428182015"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-02 21:13:35.138510"]]  (0.2ms) COMMIT [refresh_token] Token update successful (88)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-02 21:13:36.829109"], ["updated_at", "2015-04-02 21:13:36.829109"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428095616"], ["created_at", "2015-04-02 21:13:36.841789"], ["updated_at", "2015-04-02 21:13:36.841789"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (90) [refresh_token] Token still valid (90) [refresh_token] Token requested (90)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427922816"], ["created_at", "2015-04-02 21:13:36.849167"], ["updated_at", "2015-04-02 21:13:36.849167"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (91) [refresh_token] Token expired, requesting a refresh... (91) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (91)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 91) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428182016"], ["updated_at", "2015-04-02 21:13:36.861818"], ["id", 91]]  (0.2ms) COMMIT [refresh_token] Token update successful (91)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427922816"], ["created_at", "2015-04-02 21:13:36.867612"], ["updated_at", "2015-04-02 21:13:36.867612"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (92) [refresh_token] Token expired, requesting a refresh... (92) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (92)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 92) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428182016"], ["updated_at", "2015-04-02 21:13:36.870636"], ["id", 92]]  (0.2ms) COMMIT [refresh_token] Token update successful (92)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-02 21:13:36.873930"], ["updated_at", "2015-04-02 21:13:36.873930"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 93) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-02 21:13:36.875893"], ["id", 93]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 93]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.883102"], ["updated_at", "2015-04-02 21:13:36.883102"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 21:13:36.885490"], ["updated_at", "2015-04-02 21:13:36.885490"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 95) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 21:13:36.888627"], ["id", 95]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.892226"], ["updated_at", "2015-04-02 21:13:36.892226"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 21:13:36.894244"], ["updated_at", "2015-04-02 21:13:36.894244"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 97) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 21:13:36.897249"], ["id", 97]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 97]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.901054"], ["updated_at", "2015-04-02 21:13:36.901054"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-02 21:13:36.902812"], ["updated_at", "2015-04-02 21:13:36.902812"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 99) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-02 21:13:36.905243"], ["id", 99]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 99]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.908478"], ["updated_at", "2015-04-02 21:13:36.908478"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.912463"], ["updated_at", "2015-04-02 21:13:36.912463"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.916592"], ["updated_at", "2015-04-02 21:13:36.916592"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.919138"], ["updated_at", "2015-04-02 21:13:36.919138"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.922643"], ["updated_at", "2015-04-02 21:13:36.922643"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.925352"], ["updated_at", "2015-04-02 21:13:36.925352"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-02 21:13:36.928560"], ["updated_at", "2015-04-02 21:13:36.928560"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.931046"], ["updated_at", "2015-04-02 21:13:36.931046"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.947219"], ["updated_at", "2015-04-02 21:13:36.947219"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.953281"], ["updated_at", "2015-04-02 21:13:36.953281"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-02 21:13:36.958508"], ["updated_at", "2015-04-02 21:13:36.958508"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.5ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.631986"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.631986"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 4.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.638392"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.638392"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.644621"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.644621"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 2.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 06:29:17.662445"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 06:29:17.662445"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 114) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 114 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 06:29:17.665013"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 114]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 06:29:17.671375"], ["uid", 0], ["updated_at", "2015-04-03 06:29:17.671375"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.679345"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.679345"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.683742"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.683742"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.687391"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.687391"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.689835"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.689835"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.692528"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.692528"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.694981"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.694981"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.697748"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.697748"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:17.700115"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.700115"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.702958"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.702958"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.705093"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.705093"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 125) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 125 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:29:17.707457"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.710586"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.710586"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.712199"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.712199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 127) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 127 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:29:17.714419"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 127]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.717434"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:17.717434"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:17.719156"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.719156"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 129) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 129 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:29:17.721223"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 129]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:29:17.728417"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956157"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.728417"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (130) [refresh_token] Token expired, requesting a refresh... (130) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (130)  (0.4ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 130) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 130 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215357"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:29:17.737052"]]  (0.2ms) COMMIT [refresh_token] Token update successful (130)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:29:17.742820"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956157"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.742820"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (131) [refresh_token] Token expired, requesting a refresh... (131) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (131)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 131) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 131 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215357"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:29:17.745255"]]  (0.2ms) COMMIT [refresh_token] Token update successful (131)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:29:17.748736"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428128957], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:29:17.748736"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (132) [refresh_token] Token still valid (132) [refresh_token] Token requested (132)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.407274"], ["updated_at", "2015-04-03 06:29:19.407274"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 3.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.414137"], ["updated_at", "2015-04-03 06:29:19.414137"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.420558"], ["updated_at", "2015-04-03 06:29:19.420558"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 06:29:19.440649"], ["updated_at", "2015-04-03 06:29:19.440649"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427956159"], ["created_at", "2015-04-03 06:29:19.450382"], ["updated_at", "2015-04-03 06:29:19.450382"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (137) [refresh_token] Token expired, requesting a refresh... (137) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (137)  (0.2ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 137) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428215359"], ["updated_at", "2015-04-03 06:29:19.463519"], ["id", 137]]  (0.2ms) COMMIT [refresh_token] Token update successful (137)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427956159"], ["created_at", "2015-04-03 06:29:19.467768"], ["updated_at", "2015-04-03 06:29:19.467768"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (138) [refresh_token] Token expired, requesting a refresh... (138) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (138)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 138) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428215359"], ["updated_at", "2015-04-03 06:29:19.470814"], ["id", 138]]  (0.2ms) COMMIT [refresh_token] Token update successful (138)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428128959"], ["created_at", "2015-04-03 06:29:19.475199"], ["updated_at", "2015-04-03 06:29:19.475199"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (139) [refresh_token] Token still valid (139) [refresh_token] Token requested (139)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.483404"], ["updated_at", "2015-04-03 06:29:19.483404"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.488557"], ["updated_at", "2015-04-03 06:29:19.488557"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.492588"], ["updated_at", "2015-04-03 06:29:19.492588"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.495709"], ["updated_at", "2015-04-03 06:29:19.495709"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.499103"], ["updated_at", "2015-04-03 06:29:19.499103"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.501690"], ["updated_at", "2015-04-03 06:29:19.501690"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.504514"], ["updated_at", "2015-04-03 06:29:19.504514"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:29:19.507271"], ["updated_at", "2015-04-03 06:29:19.507271"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.510361"], ["updated_at", "2015-04-03 06:29:19.510361"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 06:29:19.512253"], ["updated_at", "2015-04-03 06:29:19.512253"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 149) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 06:29:19.514880"], ["id", 149]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.518111"], ["updated_at", "2015-04-03 06:29:19.518111"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 06:29:19.520031"], ["updated_at", "2015-04-03 06:29:19.520031"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 151) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 06:29:19.522671"], ["id", 151]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 151]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:29:19.527510"], ["updated_at", "2015-04-03 06:29:19.527510"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 06:29:19.529433"], ["updated_at", "2015-04-03 06:29:19.529433"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 153) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 06:29:19.532218"], ["id", 153]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (2.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 153]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 06:29:19.538523"], ["updated_at", "2015-04-03 06:29:19.538523"]]  (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"."uid" IS NULL AND "accounts"."id" != 154) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 06:29:19.540573"], ["id", 154]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 154]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.867298"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.867298"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 3.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.873612"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.873612"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.878960"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.878960"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 06:29:33.883141"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 06:29:33.883141"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 158) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 158 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 06:29:33.885629"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 158]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.894231"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.894231"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.898781"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.898781"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.902456"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.902456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.904902"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.904902"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.908056"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.908056"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.910727"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.910727"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.913816"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.913816"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:29:33.916124"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.916124"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.918811"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.918811"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.920355"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.920355"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 168) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 168 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:29:33.922676"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.925743"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.925743"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.927447"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.927447"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 170) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 170 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:29:33.929685"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 170]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.933058"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:29:33.933058"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:29:33.934773"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.934773"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 172) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 172 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:29:33.936938"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 172]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:29:33.941777"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956173"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:29:33.941777"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (173) [refresh_token] Token expired, requesting a refresh... (173) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (173) Account Load (0.5ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 173) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 173 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215373"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:29:46.802485"]]  (0.3ms) COMMIT [refresh_token] Token update successful (173)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:29:46.809077"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956186"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:29:46.809077"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (174) [refresh_token] Token expired, requesting a refresh... (174) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (174) Account Load (0.7ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token requested (174) [refresh_token] Token expired, requesting a refresh... (174) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (174)  (0.6ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 174) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 174 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215386"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:30:19.514441"]]  (0.6ms) COMMIT [refresh_token] Token update successful (174) Account Load (0.7ms) SELECT "accounts".* FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts"  (0.4ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 174) LIMIT 1  (0.3ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2015-04-03 06:31:51.113525"], ["updated_at", "2015-04-03 06:31:51.113525"]]  (0.5ms) COMMIT Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 174) LIMIT 1  (0.2ms) COMMIT [refresh_token] Token update successful (174)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:32:06.956450"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428129126], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:32:06.956450"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (176) [refresh_token] Token still valid (176) [refresh_token] Token requested (176)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:33:29.555831"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:33:29.555831"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 3.9ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:33:29.562601"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:33:29.562601"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:33:29.569105"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:33:29.569105"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 2.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:33:29.589031"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956409"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:33:29.589031"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (180) [refresh_token] Token expired, requesting a refresh... (180) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (180) Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 180) LIMIT 1  (0.3ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.4ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 180) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 180 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215609"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:34:05.403019"]]  (0.2ms) COMMIT [refresh_token] Token update successful (180)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:34:05.410170"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956445"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:34:05.410170"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (181) [refresh_token] Token expired, requesting a refresh... (181) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (181)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 181) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 181 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215645"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:34:07.556305"]]  (0.2ms) COMMIT [refresh_token] Token update successful (181)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:34:07.559892"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428129247], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.559892"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (182) [refresh_token] Token still valid (182) [refresh_token] Token requested (182)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.9ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.572771"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.572771"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:07.577509"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.577509"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.581527"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.581527"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:07.583949"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.583949"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.587122"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.587122"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:07.590155"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.590155"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.593110"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.593110"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:07.595427"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.595427"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.598277"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.598277"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.600004"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.600004"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 192) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 192 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:34:07.602631"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.605575"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.605575"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.607271"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.607271"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 194) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 194 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:34:07.609453"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 194]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.612959"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:07.612959"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:07.614921"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:07.614921"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 196) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 196 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:34:07.616942"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 196]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.093786"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.093786"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.096204"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.096204"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 198) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 198 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:34:46.100608"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.104536"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.104536"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.106284"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.106284"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 200) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 200 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:34:46.108521"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 200]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.112463"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.112463"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.114733"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.114733"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 202) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 202 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:34:46.117371"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 202]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.122179"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.122179"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:46.126152"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.126152"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.130054"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.130054"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:46.132530"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.132530"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.135749"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.135749"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:46.138125"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.138125"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:34:46.140900"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:34:46.140900"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:34:46.143107"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.143107"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:34:46.150882"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428129286], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.150882"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (211) [refresh_token] Token still valid (211) [refresh_token] Token requested (211)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:34:46.155012"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956486"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:34:46.155012"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (212) [refresh_token] Token expired, requesting a refresh... (212) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (212) Account Load (0.6ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.7ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 212) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 212 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215686"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:35:19.904109"]]  (0.2ms) COMMIT [refresh_token] Token update successful (212)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:35:19.910266"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956519"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:35:19.910266"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (213) [refresh_token] Token expired, requesting a refresh... (213) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (213)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 213) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 213 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215719"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:35:20.463506"]]  (0.3ms) COMMIT [refresh_token] Token update successful (213)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:35:20.473057"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:35:20.473057"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:35:20.479534"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:35:20.479534"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:35:20.484930"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:35:20.484930"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:35:29.235606"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956529"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:35:29.235606"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (217) [refresh_token] Token expired, requesting a refresh... (217) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (217) Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 175]]  (0.5ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.3ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 217) LIMIT 1  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.4ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 217) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 217 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215729"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:36:07.071291"]]  (0.5ms) COMMIT [refresh_token] Token update successful (217)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:36:07.080519"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427956567"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:36:07.080519"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (218) [refresh_token] Token expired, requesting a refresh... (218) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (218)  (0.6ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 218) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 218 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428215767"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 06:36:08.568816"]]  (0.5ms) COMMIT [refresh_token] Token update successful (218)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 06:36:08.572882"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428129368], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.572882"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (219) [refresh_token] Token still valid (219) [refresh_token] Token requested (219)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.576594"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.576594"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.583616"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.583616"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.587221"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.587221"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.589659"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.589659"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.592577"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.592577"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.595369"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.595369"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.599328"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.599328"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.601574"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.601574"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.604503"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.604503"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.606356"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.606356"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 229) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 229 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:36:08.608757"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.611958"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.611958"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.613536"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.613536"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 231) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 231 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:36:08.615888"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 231]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.619604"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 06:36:08.619604"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 06:36:08.621243"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.621243"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 233) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 233 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 06:36:08.623560"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 233]]  (0.2ms) ROLLBACK  (1.7ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-03 06:36:08.629381"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 06:36:08.629381"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 234) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 234 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 06:36:08.631512"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 234]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 06:36:08.640959"], ["uid", 0], ["updated_at", "2015-04-03 06:36:08.640959"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.664201"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.664201"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.668729"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.668729"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 06:36:08.673126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 06:36:08.673126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (2.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.7ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.355570"], ["updated_at", "2015-04-03 06:36:10.355570"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 3.8ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.362643"], ["updated_at", "2015-04-03 06:36:10.362643"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.369142"], ["updated_at", "2015-04-03 06:36:10.369142"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 06:36:10.390470"], ["updated_at", "2015-04-03 06:36:10.390470"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 242) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 06:36:10.396182"], ["id", 242]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 242]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 06:36:10.403118"], ["updated_at", "2015-04-03 06:36:10.403118"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.410866"], ["updated_at", "2015-04-03 06:36:10.410866"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.416495"], ["updated_at", "2015-04-03 06:36:10.416495"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.419705"], ["updated_at", "2015-04-03 06:36:10.419705"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.423071"], ["updated_at", "2015-04-03 06:36:10.423071"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.426826"], ["updated_at", "2015-04-03 06:36:10.426826"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.429542"], ["updated_at", "2015-04-03 06:36:10.429542"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.432789"], ["updated_at", "2015-04-03 06:36:10.432789"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 06:36:10.435519"], ["updated_at", "2015-04-03 06:36:10.435519"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.438777"], ["updated_at", "2015-04-03 06:36:10.438777"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 06:36:10.440753"], ["updated_at", "2015-04-03 06:36:10.440753"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 253) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 06:36:10.443495"], ["id", 253]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.446672"], ["updated_at", "2015-04-03 06:36:10.446672"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 06:36:10.448707"], ["updated_at", "2015-04-03 06:36:10.448707"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 255) LIMIT 1 SQL (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 06:36:10.451512"], ["id", 255]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 255]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 06:36:10.455382"], ["updated_at", "2015-04-03 06:36:10.455382"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 06:36:10.457386"], ["updated_at", "2015-04-03 06:36:10.457386"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 257) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 06:36:10.460038"], ["id", 257]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 257]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427956570"], ["created_at", "2015-04-03 06:36:10.463938"], ["updated_at", "2015-04-03 06:36:10.463938"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (258) [refresh_token] Token expired, requesting a refresh... (258) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (258)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 258) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428215770"], ["updated_at", "2015-04-03 06:36:11.964342"], ["id", 258]]  (0.4ms) COMMIT [refresh_token] Token update successful (258)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427956571"], ["created_at", "2015-04-03 06:36:11.969473"], ["updated_at", "2015-04-03 06:36:11.969473"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (259) [refresh_token] Token expired, requesting a refresh... (259) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (259)  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 259) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428215771"], ["updated_at", "2015-04-03 06:36:13.722903"], ["id", 259]]  (0.2ms) COMMIT [refresh_token] Token update successful (259)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428129373"], ["created_at", "2015-04-03 06:36:13.726643"], ["updated_at", "2015-04-03 06:36:13.726643"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (260) [refresh_token] Token still valid (260) [refresh_token] Token requested (260)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:22:30.165443"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428132150], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.165443"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (261) [refresh_token] Token still valid (261) [refresh_token] Token requested (261)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:22:30.170146"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427959350"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.170146"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (262) [refresh_token] Token expired, requesting a refresh... (262) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (262)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 262) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 262 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428218550"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:22:30.180105"]]  (0.2ms) COMMIT [refresh_token] Token update successful (262)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:22:30.187096"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427959350"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.187096"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (263) [refresh_token] Token expired, requesting a refresh... (263) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (263)  (0.2ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 263) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 263 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428218550"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:22:30.190517"]]  (0.2ms) COMMIT [refresh_token] Token update successful (263)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 07:22:30.196313"], ["uid", 0], ["updated_at", "2015-04-03 07:22:30.196313"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.204186"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.204186"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.206382"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.206382"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 266) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 266 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:22:30.210188"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.214174"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.214174"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.216415"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.216415"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 268) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 268 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:22:30.219041"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 268]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.223053"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.223053"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.225099"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.225099"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 270) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 270 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:22:30.227434"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 270]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.231023"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.231023"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.234892"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.234892"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.239105"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.239105"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.241327"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.241327"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.7ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.244326"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.244326"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.247232"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.247232"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:30.249827"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:30.249827"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.251931"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.251931"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 07:22:30.254578"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 07:22:30.254578"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 279) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 279 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 07:22:30.256261"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 279]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.261786"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.261786"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.268107"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.268107"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:30.273213"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:30.273213"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) ROLLBACK  (0.4ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-04-03 07:22:31.950303"], ["updated_at", "2015-04-03 07:22:31.950303"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 283) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 07:22:31.953263"], ["id", 283]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 283]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428132151"], ["created_at", "2015-04-03 07:22:31.959826"], ["updated_at", "2015-04-03 07:22:31.959826"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (284) [refresh_token] Token still valid (284) [refresh_token] Token requested (284)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427959351"], ["created_at", "2015-04-03 07:22:31.963697"], ["updated_at", "2015-04-03 07:22:31.963697"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (285) [refresh_token] Token expired, requesting a refresh... (285) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (285)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 285) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428218551"], ["updated_at", "2015-04-03 07:22:31.976313"], ["id", 285]]  (0.2ms) COMMIT [refresh_token] Token update successful (285)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427959351"], ["created_at", "2015-04-03 07:22:31.980702"], ["updated_at", "2015-04-03 07:22:31.980702"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (286) [refresh_token] Token expired, requesting a refresh... (286) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (286)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 286) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428218551"], ["updated_at", "2015-04-03 07:22:31.983672"], ["id", 286]]  (0.2ms) COMMIT [refresh_token] Token update successful (286)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 07:22:31.990096"], ["updated_at", "2015-04-03 07:22:31.990096"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:31.997925"], ["updated_at", "2015-04-03 07:22:31.997925"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 07:22:32.000316"], ["updated_at", "2015-04-03 07:22:32.000316"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 289) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 07:22:32.003525"], ["id", 289]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:32.007440"], ["updated_at", "2015-04-03 07:22:32.007440"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 07:22:32.009645"], ["updated_at", "2015-04-03 07:22:32.009645"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 291) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 07:22:32.012545"], ["id", 291]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 291]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:32.016413"], ["updated_at", "2015-04-03 07:22:32.016413"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 07:22:32.018294"], ["updated_at", "2015-04-03 07:22:32.018294"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 293) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 07:22:32.021006"], ["id", 293]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 293]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:32.024819"], ["updated_at", "2015-04-03 07:22:32.024819"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.028849"], ["updated_at", "2015-04-03 07:22:32.028849"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:32.032517"], ["updated_at", "2015-04-03 07:22:32.032517"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.035356"], ["updated_at", "2015-04-03 07:22:32.035356"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:32.038615"], ["updated_at", "2015-04-03 07:22:32.038615"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.041346"], ["updated_at", "2015-04-03 07:22:32.041346"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:22:32.044276"], ["updated_at", "2015-04-03 07:22:32.044276"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.047052"], ["updated_at", "2015-04-03 07:22:32.047052"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.077311"], ["updated_at", "2015-04-03 07:22:32.077311"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.083608"], ["updated_at", "2015-04-03 07:22:32.083608"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:22:32.089049"], ["updated_at", "2015-04-03 07:22:32.089049"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 2ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.591433"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.591433"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 4.2ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.598151"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.598151"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.603755"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.603755"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 07:22:52.621021"], ["uid", 0], ["updated_at", "2015-04-03 07:22:52.621021"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.632929"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.632929"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.635133"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.635133"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 310) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 310 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:22:52.638263"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.642867"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.642867"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.644567"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.644567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 312) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 312 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:22:52.646950"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 312]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.650762"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.650762"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.652465"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.652465"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 314) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 314 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:22:52.655132"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 314]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.658960"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.658960"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.662791"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.662791"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.666085"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.666085"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.668776"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.668776"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.671830"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.671830"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.674117"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.674117"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:22:52.676801"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:22:52.676801"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:22:52.679314"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.679314"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 07:22:52.683048"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 07:22:52.683048"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 323) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 323 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 07:22:52.684838"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 323]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:22:52.688809"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428132172], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.688809"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (324) [refresh_token] Token still valid (324) [refresh_token] Token requested (324)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:22:52.692709"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427959372"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:22:52.692709"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (325) [refresh_token] Token expired, requesting a refresh... (325) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (325) Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (1.0ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.5ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 325) LIMIT 1  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 325) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 325 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428218572"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:34:48.042972"]]  (0.3ms) COMMIT [refresh_token] Token update successful (325)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:34:48.049268"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427960088"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:34:48.049268"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (326) [refresh_token] Token expired, requesting a refresh... (326) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (326)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 326) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 326 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428219288"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:34:50.801550"]]  (0.2ms) COMMIT [refresh_token] Token update successful (326)  (0.2ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.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 0ms (ActiveRecord: 0.0ms) 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.2ms | ActiveRecord: 0.0ms) 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.2ms | ActiveRecord: 0.0ms) [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428132892"], ["created_at", "2015-04-03 07:34:52.480464"], ["updated_at", "2015-04-03 07:34:52.480464"]]  (0.4ms) COMMIT [refresh_token] Token requested (327) [refresh_token] Token still valid (327) [refresh_token] Token requested (327)  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:34:52.495657"], ["updated_at", "2015-04-03 07:34:52.495657"]]  (0.4ms) COMMIT  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 07:34:52.512168"], ["updated_at", "2015-04-03 07:34:52.512168"]]  (0.4ms) COMMIT  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 329) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 07:34:52.515119"], ["id", 329]]  (0.4ms) COMMIT Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 329]] Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) BEGIN Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.1ms) ROLLBACK Completed 422 Unprocessable Entity in 2ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms) Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 18ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.3ms | ActiveRecord: 0.0ms) Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | 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 0ms (ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.4ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 19ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms) Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.5ms | 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 0ms (ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms) [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | 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 0ms (ActiveRecord: 0.0ms) Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms) Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.7ms) ROLLBACK Completed 422 Unprocessable Entity in 19ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Completed 422 Unprocessable Entity in 3ms Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms) Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms) Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1  (0.2ms) ROLLBACK [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.5ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 56 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:41:09.777459"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427960469"], ["oauth_refresh_token", "refresh_token"], ["uid", 56], ["updated_at", "2015-04-03 07:41:09.777459"]]  (0.4ms) COMMIT [refresh_token] Token requested (330) [refresh_token] Token expired, requesting a refresh... (330) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (330) Account Load (0.5ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 327]]  (0.9ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 328]]  (0.3ms) COMMIT  (0.3ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 329]]  (0.4ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 330]]  (0.3ms) COMMIT Account Load (0.9ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 56 AND "accounts"."id" != 330) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 330 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428219669"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:41:46.354675"]]  (0.2ms) COMMIT [refresh_token] Token update successful (330)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 56 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 56], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427960507"], ["created_at", "2015-04-03 07:41:47.982817"], ["updated_at", "2015-04-03 07:41:47.982817"]]  (0.4ms) COMMIT [refresh_token] Token requested (331) [refresh_token] Token expired, requesting a refresh... (331) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (331) Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 56 AND "accounts"."id" != 331) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428219707"], ["updated_at", "2015-04-03 07:42:03.534585"], ["id", 331]]  (0.8ms) COMMIT [refresh_token] Token update successful (331)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 56 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:42:25.361799"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427960545"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:42:25.361799"]]  (0.5ms) COMMIT [refresh_token] Token requested (332) [refresh_token] Token expired, requesting a refresh... (332) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (332) Account Load (1.2ms) SELECT "accounts".* FROM "accounts"  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (1.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 332) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 332 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428219745"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:43:30.664722"]]  (0.5ms) COMMIT [refresh_token] Token update successful (332)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:45:34.254614"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427960734"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:45:34.254614"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (1.0ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428219934"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:45:48.534483"]]  (0.3ms) COMMIT [refresh_token] Token update successful (1)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427960750"], ["created_at", "2015-04-03 07:45:50.163446"], ["updated_at", "2015-04-03 07:45:50.163446"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" Account Load (0.8ms) SELECT "accounts".* FROM "accounts"  (0.7ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428219950"], ["updated_at", "2015-04-03 07:46:00.709749"], ["id", 2]]  (1.4ms) COMMIT [refresh_token] Token update successful (2)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:52:05.613019"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961125"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:52:05.613019"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3) Account Load (1.0ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts"  (0.4ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428220325"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:52:32.671892"]]  (0.3ms) COMMIT [refresh_token] Token update successful (3)  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961154"], ["created_at", "2015-04-03 07:52:34.314867"], ["updated_at", "2015-04-03 07:52:34.314867"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1  (0.3ms) COMMIT Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428220354"], ["updated_at", "2015-04-03 07:53:05.495535"], ["id", 4]]  (0.2ms) COMMIT [refresh_token] Token update successful (4)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:53:50.083784"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961230"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:53:50.083784"]]  (0.4ms) COMMIT [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5) Account Load (0.6ms) SELECT "accounts".* FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428220430"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:54:23.437636"]]  (1.1ms) COMMIT [refresh_token] Token update successful (5) Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1  (0.2ms) COMMIT [refresh_token] Token update successful (5)  (1.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (1.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]]  (0.5ms) COMMIT  (1.2ms) BEGIN Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:56:06.974529"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961366"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:56:06.974529"]]  (0.5ms) COMMIT [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (1.0ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428220566"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:56:08.721461"]]  (0.7ms) COMMIT [refresh_token] Token update successful (1) Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.9ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 1]]  (0.3ms) COMMIT  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961370"], ["created_at", "2015-04-03 07:56:10.347533"], ["updated_at", "2015-04-03 07:56:10.347533"]]  (0.9ms) COMMIT [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.2ms) BEGIN Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428220570"], ["updated_at", "2015-04-03 07:56:11.383007"], ["id", 2]]  (0.4ms) COMMIT [refresh_token] Token update successful (2) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:56:15.922327"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961375"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:56:15.922327"]]  (0.5ms) COMMIT [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428220575"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:56:17.895217"]]  (0.7ms) COMMIT [refresh_token] Token update successful (3) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]]  (0.6ms) COMMIT  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961379"], ["created_at", "2015-04-03 07:56:19.526423"], ["updated_at", "2015-04-03 07:56:19.526423"]]  (0.5ms) COMMIT [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428220579"], ["updated_at", "2015-04-03 07:57:33.375696"], ["id", 4]]  (0.5ms) COMMIT [refresh_token] Token update successful (4) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]]  (0.4ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.042764"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.042764"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:57:45.051290"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.051290"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.055474"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.055474"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:57:45.058076"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.058076"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.061755"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.061755"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:57:45.064380"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.064380"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.067708"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.067708"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 07:57:45.070238"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.070238"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.073124"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.073124"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.075148"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.075148"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 14 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:57:45.078289"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.081685"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.081685"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.083533"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.083533"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:57:45.086071"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.090113"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 07:57:45.090113"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 07:57:45.092063"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.092063"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 18 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 07:57:45.094810"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:57:45.105865"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961465"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.105865"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428220665"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:57:45.116195"]]  (0.1ms) COMMIT [refresh_token] Token update successful (19)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:57:45.121817"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961465"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.121817"]]  (0.4ms) COMMIT [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428220665"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 07:57:45.125391"]]  (0.3ms) COMMIT [refresh_token] Token update successful (20) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]]  (0.3ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 07:57:45.131410"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428134265], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 07:57:45.131410"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (21) [refresh_token] Token still valid (21) [refresh_token] Token requested (21)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 07:57:45.134329"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 07:57:45.134329"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 22) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 22 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 07:57:45.136324"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 07:57:45.141855"], ["uid", 0], ["updated_at", "2015-04-03 07:57:45.141855"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.761069"], ["updated_at", "2015-04-03 07:57:46.761069"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:57:46.768694"], ["updated_at", "2015-04-03 07:57:46.768694"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.772681"], ["updated_at", "2015-04-03 07:57:46.772681"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:57:46.775415"], ["updated_at", "2015-04-03 07:57:46.775415"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.778945"], ["updated_at", "2015-04-03 07:57:46.778945"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:57:46.781502"], ["updated_at", "2015-04-03 07:57:46.781502"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.784601"], ["updated_at", "2015-04-03 07:57:46.784601"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 07:57:46.787333"], ["updated_at", "2015-04-03 07:57:46.787333"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.790271"], ["updated_at", "2015-04-03 07:57:46.790271"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 07:57:46.792174"], ["updated_at", "2015-04-03 07:57:46.792174"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 33) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 07:57:46.795306"], ["id", 33]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (1.0ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.800549"], ["updated_at", "2015-04-03 07:57:46.800549"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 07:57:46.802864"], ["updated_at", "2015-04-03 07:57:46.802864"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 35) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 07:57:46.806547"], ["id", 35]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 35]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 07:57:46.811808"], ["updated_at", "2015-04-03 07:57:46.811808"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 07:57:46.813696"], ["updated_at", "2015-04-03 07:57:46.813696"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 37) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 07:57:46.816798"], ["id", 37]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 37]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 07:57:46.826387"], ["updated_at", "2015-04-03 07:57:46.826387"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 38) LIMIT 1 SQL (0.1ms) 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", "2015-04-03 07:57:46.828749"], ["id", 38]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 38]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961466"], ["created_at", "2015-04-03 07:57:46.834014"], ["updated_at", "2015-04-03 07:57:46.834014"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (39) [refresh_token] Token expired, requesting a refresh... (39) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (39)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 39) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428220666"], ["updated_at", "2015-04-03 07:57:46.845735"], ["id", 39]]  (0.1ms) COMMIT [refresh_token] Token update successful (39)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961466"], ["created_at", "2015-04-03 07:57:46.850495"], ["updated_at", "2015-04-03 07:57:46.850495"]]  (0.6ms) COMMIT [refresh_token] Token requested (40) [refresh_token] Token expired, requesting a refresh... (40) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (40)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 40) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428220666"], ["updated_at", "2015-04-03 07:57:46.854149"], ["id", 40]]  (0.5ms) COMMIT [refresh_token] Token update successful (40) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 40]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 40]]  (0.3ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428134266"], ["created_at", "2015-04-03 07:57:46.861205"], ["updated_at", "2015-04-03 07:57:46.861205"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (41) [refresh_token] Token still valid (41) [refresh_token] Token requested (41)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 07:57:46.867508"], ["updated_at", "2015-04-03 07:57:46.867508"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-03 08:05:46.947220"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:05:46.947220"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 43) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 43 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:05:46.950326"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 43]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:05:46.955812"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428134746], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:05:46.955812"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (44) [refresh_token] Token still valid (44) [refresh_token] Token requested (44)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:05:46.959969"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961946"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:05:46.959969"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (45) [refresh_token] Token expired, requesting a refresh... (45) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (45)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 45) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 45 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221146"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:05:46.962316"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (45)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:05:46.965624"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961946"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:05:46.965624"]]  (0.4ms) COMMIT [refresh_token] Token requested (46) [refresh_token] Token expired, requesting a refresh... (46) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (46)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 46) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 46 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221146"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:05:46.968193"]]  (0.3ms) COMMIT [refresh_token] Token update successful (46) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 46]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 46]]  (0.3ms) COMMIT  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 08:05:46.975151"], ["uid", 0], ["updated_at", "2015-04-03 08:05:46.975151"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:46.983468"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:46.983468"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:46.985855"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:46.985855"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 49) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 49 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:05:46.990107"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:46.993671"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:46.993671"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:46.995535"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:46.995535"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 51) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 51 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:05:46.997863"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 51]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:47.001212"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:47.001212"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:47.002976"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:47.002976"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 53) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 53 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:05:47.005209"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 53]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:47.008943"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:47.008943"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:47.014808"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:47.014808"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:47.018748"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:47.018748"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:47.021068"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:47.021068"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:47.023922"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:47.023922"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:47.026273"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:47.026273"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:47.029096"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:47.029096"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:47.031589"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:47.031589"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 08:05:48.641616"], ["updated_at", "2015-04-03 08:05:48.641616"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.653272"], ["updated_at", "2015-04-03 08:05:48.653272"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:05:48.655504"], ["updated_at", "2015-04-03 08:05:48.655504"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 64) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:05:48.660486"], ["id", 64]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.664680"], ["updated_at", "2015-04-03 08:05:48.664680"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:05:48.666653"], ["updated_at", "2015-04-03 08:05:48.666653"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 66) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:05:48.669317"], ["id", 66]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 66]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.674025"], ["updated_at", "2015-04-03 08:05:48.674025"]]  (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"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:05:48.675947"], ["updated_at", "2015-04-03 08:05:48.675947"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 68) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:05:48.678812"], ["id", 68]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 68]]  (0.3ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.682443"], ["updated_at", "2015-04-03 08:05:48.682443"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:05:48.687468"], ["updated_at", "2015-04-03 08:05:48.687468"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.691272"], ["updated_at", "2015-04-03 08:05:48.691272"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:05:48.693800"], ["updated_at", "2015-04-03 08:05:48.693800"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.696625"], ["updated_at", "2015-04-03 08:05:48.696625"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:05:48.699234"], ["updated_at", "2015-04-03 08:05:48.699234"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:05:48.702209"], ["updated_at", "2015-04-03 08:05:48.702209"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:05:48.704590"], ["updated_at", "2015-04-03 08:05:48.704590"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428134748"], ["created_at", "2015-04-03 08:05:48.714287"], ["updated_at", "2015-04-03 08:05:48.714287"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (77) [refresh_token] Token still valid (77) [refresh_token] Token requested (77)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961948"], ["created_at", "2015-04-03 08:05:48.718775"], ["updated_at", "2015-04-03 08:05:48.718775"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (78) [refresh_token] Token expired, requesting a refresh... (78) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (78)  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 78) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221148"], ["updated_at", "2015-04-03 08:05:48.720910"], ["id", 78]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (78)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961948"], ["created_at", "2015-04-03 08:05:48.724224"], ["updated_at", "2015-04-03 08:05:48.724224"]]  (0.4ms) COMMIT [refresh_token] Token requested (79) [refresh_token] Token expired, requesting a refresh... (79) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (79)  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 79) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221148"], ["updated_at", "2015-04-03 08:05:48.726721"], ["id", 79]]  (0.4ms) COMMIT [refresh_token] Token update successful (79) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 79]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 79]]  (0.7ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 08:05:48.732350"], ["updated_at", "2015-04-03 08:05:48.732350"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 80) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 08:05:48.734498"], ["id", 80]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 80]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.0ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.811244"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.811244"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 3.9ms)  (0.6ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.818445"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.818445"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.823670"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.823670"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 08:05:58.827116"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:05:58.827116"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 84) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 84 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:05:58.829671"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 84]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 08:05:58.835799"], ["uid", 0], ["updated_at", "2015-04-03 08:05:58.835799"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.844475"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.844475"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.849419"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.849419"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.853352"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.853352"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.856005"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.856005"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.859714"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.859714"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.862200"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.862200"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.864999"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.864999"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:05:58.867453"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.867453"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.870455"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.870455"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.872355"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.872355"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 95) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 95 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:05:58.874764"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.878168"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.878168"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.879573"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.879573"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 97) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 97 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:05:58.882121"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 97]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.885599"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:05:58.885599"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:05:58.887374"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.887374"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 99) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 99 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:05:58.889611"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 99]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:05:58.893562"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961958"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.893562"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (100) [refresh_token] Token expired, requesting a refresh... (100) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (100)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 100) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 100 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221158"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:05:58.895719"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (100)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:05:58.898715"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961958"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.898715"]]  (0.4ms) COMMIT [refresh_token] Token requested (101) [refresh_token] Token expired, requesting a refresh... (101) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (101)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 101) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 101 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221158"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:05:58.901113"]]  (0.5ms) COMMIT [refresh_token] Token update successful (101) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 101]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.3ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 101]]  (0.4ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:05:58.907162"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428134758], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:05:58.907162"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (102) [refresh_token] Token still valid (102) [refresh_token] Token requested (102)  (0.1ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.7ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.585634"], ["updated_at", "2015-04-03 08:06:00.585634"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 5.1ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.592736"], ["updated_at", "2015-04-03 08:06:00.592736"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.600291"], ["updated_at", "2015-04-03 08:06:00.600291"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 08:06:00.604244"], ["updated_at", "2015-04-03 08:06:00.604244"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 106) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 08:06:00.607127"], ["id", 106]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 106]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (1.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.616433"], ["updated_at", "2015-04-03 08:06:00.616433"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.622941"], ["updated_at", "2015-04-03 08:06:00.622941"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.626638"], ["updated_at", "2015-04-03 08:06:00.626638"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.629245"], ["updated_at", "2015-04-03 08:06:00.629245"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.632389"], ["updated_at", "2015-04-03 08:06:00.632389"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.635494"], ["updated_at", "2015-04-03 08:06:00.635494"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.638821"], ["updated_at", "2015-04-03 08:06:00.638821"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:00.641595"], ["updated_at", "2015-04-03 08:06:00.641595"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.644629"], ["updated_at", "2015-04-03 08:06:00.644629"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:06:00.646896"], ["updated_at", "2015-04-03 08:06:00.646896"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 116) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:06:00.649225"], ["id", 116]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.652601"], ["updated_at", "2015-04-03 08:06:00.652601"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:06:00.654879"], ["updated_at", "2015-04-03 08:06:00.654879"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 118) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:06:00.658329"], ["id", 118]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 118]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:00.662203"], ["updated_at", "2015-04-03 08:06:00.662203"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:06:00.664437"], ["updated_at", "2015-04-03 08:06:00.664437"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 120) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:06:00.667460"], ["id", 120]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 120]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961960"], ["created_at", "2015-04-03 08:06:00.672141"], ["updated_at", "2015-04-03 08:06:00.672141"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (121) [refresh_token] Token expired, requesting a refresh... (121) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (121)  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 121) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221160"], ["updated_at", "2015-04-03 08:06:00.674561"], ["id", 121]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (121)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961960"], ["created_at", "2015-04-03 08:06:00.677761"], ["updated_at", "2015-04-03 08:06:00.677761"]]  (0.6ms) COMMIT [refresh_token] Token requested (122) [refresh_token] Token expired, requesting a refresh... (122) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (122)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 122) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221160"], ["updated_at", "2015-04-03 08:06:00.681507"], ["id", 122]]  (0.6ms) COMMIT [refresh_token] Token update successful (122) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 122]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 122]]  (0.6ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428134760"], ["created_at", "2015-04-03 08:06:00.688113"], ["updated_at", "2015-04-03 08:06:00.688113"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (123) [refresh_token] Token still valid (123) [refresh_token] Token requested (123)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 08:06:00.693611"], ["updated_at", "2015-04-03 08:06:00.693611"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:06:17.986655"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428134777], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:06:17.986655"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (125) [refresh_token] Token still valid (125) [refresh_token] Token requested (125)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:06:17.996166"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961977"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:06:17.996166"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (126) [refresh_token] Token expired, requesting a refresh... (126) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (126)  (0.2ms) BEGIN Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 126) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 126 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221177"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:06:18.011553"]]  (0.2ms) COMMIT [refresh_token] Token update successful (126)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:06:18.019148"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427961978"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.019148"]]  (0.5ms) COMMIT [refresh_token] Token requested (127) [refresh_token] Token expired, requesting a refresh... (127) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (127)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 127) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 127 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221178"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:06:18.022288"]]  (0.5ms) COMMIT [refresh_token] Token update successful (127) Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 127]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 127]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.4ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 08:06:18.032257"], ["uid", 0], ["updated_at", "2015-04-03 08:06:18.032257"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 08:06:18.040226"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:06:18.040226"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 129) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 129 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:06:18.042384"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 129]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.046145"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.046145"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.048172"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.048172"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 131) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 131 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:06:18.051938"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.055961"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.055961"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.058297"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.058297"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 133) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 133 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:06:18.061101"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 133]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.065149"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.065149"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.066980"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.066980"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 135) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 135 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:06:18.069368"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 135]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.073325"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.073325"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.077310"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.077310"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.081235"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.081235"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.083655"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.083655"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.086664"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.086664"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.089131"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.089131"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:06:18.092296"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:06:18.092296"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.095013"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.095013"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.130420"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.130420"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.135231"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.135231"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:06:18.140802"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:06:18.140802"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-04-03 08:06:19.793352"], ["updated_at", "2015-04-03 08:06:19.793352"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 147) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 08:06:19.796752"], ["id", 147]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 147]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961979"], ["created_at", "2015-04-03 08:06:19.803744"], ["updated_at", "2015-04-03 08:06:19.803744"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (148) [refresh_token] Token expired, requesting a refresh... (148) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (148)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 148) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221179"], ["updated_at", "2015-04-03 08:06:19.815313"], ["id", 148]]  (0.2ms) COMMIT [refresh_token] Token update successful (148)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427961979"], ["created_at", "2015-04-03 08:06:19.819365"], ["updated_at", "2015-04-03 08:06:19.819365"]]  (0.4ms) COMMIT [refresh_token] Token requested (149) [refresh_token] Token expired, requesting a refresh... (149) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (149)  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 149) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221179"], ["updated_at", "2015-04-03 08:06:19.822925"], ["id", 149]]  (0.4ms) COMMIT [refresh_token] Token update successful (149) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 149]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 149]]  (0.5ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428134779"], ["created_at", "2015-04-03 08:06:19.830935"], ["updated_at", "2015-04-03 08:06:19.830935"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (150) [refresh_token] Token still valid (150) [refresh_token] Token requested (150)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.834208"], ["updated_at", "2015-04-03 08:06:19.834208"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.838762"], ["updated_at", "2015-04-03 08:06:19.838762"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.842519"], ["updated_at", "2015-04-03 08:06:19.842519"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (1.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.846739"], ["updated_at", "2015-04-03 08:06:19.846739"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.850222"], ["updated_at", "2015-04-03 08:06:19.850222"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.852991"], ["updated_at", "2015-04-03 08:06:19.852991"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.856850"], ["updated_at", "2015-04-03 08:06:19.856850"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.859661"], ["updated_at", "2015-04-03 08:06:19.859661"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.862957"], ["updated_at", "2015-04-03 08:06:19.862957"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:06:19.864900"], ["updated_at", "2015-04-03 08:06:19.864900"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 160) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:06:19.867683"], ["id", 160]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.871043"], ["updated_at", "2015-04-03 08:06:19.871043"]]  (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"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:06:19.873098"], ["updated_at", "2015-04-03 08:06:19.873098"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 162) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:06:19.876001"], ["id", 162]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 162]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:06:19.879985"], ["updated_at", "2015-04-03 08:06:19.879985"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:06:19.882122"], ["updated_at", "2015-04-03 08:06:19.882122"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 164) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:06:19.884945"], ["id", 164]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 164]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 08:06:19.890325"], ["updated_at", "2015-04-03 08:06:19.890325"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.917790"], ["updated_at", "2015-04-03 08:06:19.917790"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.923583"], ["updated_at", "2015-04-03 08:06:19.923583"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:06:19.929158"], ["updated_at", "2015-04-03 08:06:19.929158"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:13:58.612268"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428135238], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:13:58.612268"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (169) [refresh_token] Token still valid (169) [refresh_token] Token requested (169)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:13:58.621445"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427962438"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:13:58.621445"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (170) [refresh_token] Token expired, requesting a refresh... (170) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (170)  (0.2ms) BEGIN Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 170) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 170 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221638"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:15:17.361555"]]  (0.1ms) COMMIT [refresh_token] Token update successful (170)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-03 08:15:17.367678"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427962517"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:15:17.367678"]]  (0.5ms) COMMIT [refresh_token] Token requested (171) [refresh_token] Token expired, requesting a refresh... (171) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (171)  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 171) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 171 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428221717"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:15:18.275157"]]  (0.7ms) COMMIT [refresh_token] Token update successful (171) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 171]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 171]]  (0.3ms) COMMIT  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (1.4ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-04-03 08:15:18.287340"], ["uid", 0], ["updated_at", "2015-04-03 08:15:18.287340"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) 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", "2015-04-03 08:15:18.298824"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:15:18.298824"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 173) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 173 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:15:18.301072"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 173]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.305730"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.305730"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.307878"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.307878"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 175) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 175 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:15:18.311905"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.315992"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.315992"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.318295"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.318295"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 177) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 177 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:15:18.321185"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 177]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.325020"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.325020"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.327170"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.327170"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 179) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3, "oauth_refresh_token" = $4, "updated_at" = $5 WHERE "accounts"."id" = 179 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:15:18.329619"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 179]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.333726"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.333726"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.339691"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.339691"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.343465"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.343465"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.345817"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.345817"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.348798"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.348798"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.351206"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.351206"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-04-03 08:15:18.353884"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:15:18.353884"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.356240"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.356240"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.385442"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.385442"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.390737"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.390737"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2015-04-03 08:15:18.395974"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:15:18.395974"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428135320"], ["created_at", "2015-04-03 08:15:20.041709"], ["updated_at", "2015-04-03 08:15:20.041709"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (191) [refresh_token] Token still valid (191) [refresh_token] Token requested (191)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427962520"], ["created_at", "2015-04-03 08:15:20.050498"], ["updated_at", "2015-04-03 08:15:20.050498"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (192) [refresh_token] Token expired, requesting a refresh... (192) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (192) test test  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 192) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221720"], ["updated_at", "2015-04-03 08:15:20.063143"], ["id", 192]]  (0.1ms) COMMIT [refresh_token] Token update successful (192)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427962520"], ["created_at", "2015-04-03 08:15:20.068941"], ["updated_at", "2015-04-03 08:15:20.068941"]]  (0.5ms) COMMIT [refresh_token] Token requested (193) [refresh_token] Token expired, requesting a refresh... (193) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (193) test test  (0.3ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 193) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428221720"], ["updated_at", "2015-04-03 08:15:20.072524"], ["id", 193]]  (0.4ms) COMMIT [refresh_token] Token update successful (193) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 193]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 193]]  (0.4ms) COMMIT  (0.2ms) BEGIN [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.083332"], ["updated_at", "2015-04-03 08:15:20.083332"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:15:20.085446"], ["updated_at", "2015-04-03 08:15:20.085446"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 195) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:15:20.088612"], ["id", 195]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.092049"], ["updated_at", "2015-04-03 08:15:20.092049"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:15:20.094140"], ["updated_at", "2015-04-03 08:15:20.094140"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 197) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:15:20.096957"], ["id", 197]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 197]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.100913"], ["updated_at", "2015-04-03 08:15:20.100913"]]  (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"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:15:20.102943"], ["updated_at", "2015-04-03 08:15:20.102943"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 199) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2015-04-03 08:15:20.105862"], ["id", 199]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 199]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.109111"], ["updated_at", "2015-04-03 08:15:20.109111"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (1.6ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.114963"], ["updated_at", "2015-04-03 08:15:20.114963"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.119416"], ["updated_at", "2015-04-03 08:15:20.119416"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.122169"], ["updated_at", "2015-04-03 08:15:20.122169"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.125393"], ["updated_at", "2015-04-03 08:15:20.125393"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.127854"], ["updated_at", "2015-04-03 08:15:20.127854"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:15:20.130939"], ["updated_at", "2015-04-03 08:15:20.130939"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.133681"], ["updated_at", "2015-04-03 08:15:20.133681"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["uid", 0], ["created_at", "2015-04-03 08:15:20.138922"], ["updated_at", "2015-04-03 08:15:20.138922"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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", "2015-04-03 08:15:20.146863"], ["updated_at", "2015-04-03 08:15:20.146863"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 209) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-04-03 08:15:20.149251"], ["id", 209]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 209]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.171548"], ["updated_at", "2015-04-03 08:15:20.171548"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.177820"], ["updated_at", "2015-04-03 08:15:20.177820"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "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" [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:15:20.184232"], ["updated_at", "2015-04-03 08:15:20.184232"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) 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 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.929073"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.929073"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.934343"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.934343"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.938086"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.938086"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.962136"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.962136"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.965269"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.965269"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.967526"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.967526"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.969106"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.969106"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.971249"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.971249"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.972758"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.972758"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.974471"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.974471"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.975949"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.975949"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.977714"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.977714"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.979006"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.979006"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:23:26.980890"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.983032"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.983032"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.984138"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.984138"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:23:26.985634"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.987798"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:23:26.987798"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.988932"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:23:26.988932"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-04-03 08:23:26.990491"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:26.992606"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:23:26.992606"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-04-03 08:23:26.993706"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-03 08:23:26.997724"], ["uid", 0], ["updated_at", "2015-04-03 08:23:26.997724"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:27.006310"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963007"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:23:27.006310"]]  (2.3ms) commit transaction [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222207"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:23:27.010697"]]  (1.4ms) commit transaction [refresh_token] Token update successful (1) Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:27.017834"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963007"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:23:27.017834"]]  (1.2ms) commit transaction [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.0ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1428222207"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:23:27.020583"]]  (1.1ms) commit transaction [refresh_token] Token update successful (2) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.3ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:23:27.025702"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428135807], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:23:27.025702"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-04-03 08:23:28.664396"], ["updated_at", "2015-04-03 08:23:28.664396"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) 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-04-03 08:23:28.673855"], ["updated_at", "2015-04-03 08:23:28.673855"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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-04-03 08:23:28.676098"], ["id", 3]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.681169"], ["updated_at", "2015-04-03 08:23:28.681169"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:23:28.682705"], ["updated_at", "2015-04-03 08:23:28.682705"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) 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-04-03 08:23:28.684517"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.686862"], ["updated_at", "2015-04-03 08:23:28.686862"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:23:28.688396"], ["updated_at", "2015-04-03 08:23:28.688396"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) 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-04-03 08:23:28.690331"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.692801"], ["updated_at", "2015-04-03 08:23:28.692801"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:23:28.694218"], ["updated_at", "2015-04-03 08:23:28.694218"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) 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-04-03 08:23:28.695952"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.698047"], ["updated_at", "2015-04-03 08:23:28.698047"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.701079"], ["updated_at", "2015-04-03 08:23:28.701079"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.703455"], ["updated_at", "2015-04-03 08:23:28.703455"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.705065"], ["updated_at", "2015-04-03 08:23:28.705065"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.707017"], ["updated_at", "2015-04-03 08:23:28.707017"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.708920"], ["updated_at", "2015-04-03 08:23:28.708920"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:23:28.710950"], ["updated_at", "2015-04-03 08:23:28.710950"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.712718"], ["updated_at", "2015-04-03 08:23:28.712718"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428135808"], ["created_at", "2015-04-03 08:23:28.714928"], ["updated_at", "2015-04-03 08:23:28.714928"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token still valid (3) [refresh_token] Token requested (3)  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963008"], ["created_at", "2015-04-03 08:23:28.723488"], ["updated_at", "2015-04-03 08:23:28.723488"]]  (1.7ms) commit transaction [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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", "1428222208"], ["updated_at", "2015-04-03 08:23:28.727801"], ["id", 3]]  (1.4ms) commit transaction [refresh_token] Token update successful (3) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (1.5ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963008"], ["created_at", "2015-04-03 08:23:28.734080"], ["updated_at", "2015-04-03 08:23:28.734080"]]  (2.2ms) commit transaction [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1428222208"], ["updated_at", "2015-04-03 08:23:28.738567"], ["id", 4]]  (1.3ms) commit transaction [refresh_token] Token update successful (4) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (1.8ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 2ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.768970"], ["updated_at", "2015-04-03 08:23:28.768970"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.773871"], ["updated_at", "2015-04-03 08:23:28.773871"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:23:28.778151"], ["updated_at", "2015-04-03 08:23:28.778151"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.813295"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.813295"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.817746"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.817746"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.821501"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.821501"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.827359"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.827359"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.828635"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.828635"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:26:16.830782"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.833252"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.833252"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.834565"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.834565"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:26:16.836006"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.838130"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.838130"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.839304"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.839304"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:26:16.840747"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.842984"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.842984"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.845770"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.845770"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.847897"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.847897"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.849434"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.849434"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.851751"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.851751"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.853203"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.853203"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.854979"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:16.854979"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.856357"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.856357"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.858538"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428135976], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.858538"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token still valid (5) [refresh_token] Token requested (5)  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.860719"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963176"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.860719"]]  (1.7ms) commit transaction [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222376"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:26:16.864234"]]  (1.1ms) commit transaction [refresh_token] Token update successful (5) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (1.2ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.869595"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963176"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:26:16.869595"]]  (1.2ms) commit transaction [refresh_token] Token requested (6) [refresh_token] Token expired, requesting a refresh... (6) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (6)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222376"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:26:16.872453"]]  (0.9ms) commit transaction [refresh_token] Token update successful (6) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (1.6ms) commit transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-03 08:26:16.880138"], ["uid", 0], ["updated_at", "2015-04-03 08:26:16.880138"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:16.885930"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:26:16.885930"]]  (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"."uid" IS NULL AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:26:16.887230"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 7]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428135981"], ["created_at", "2015-04-03 08:26:21.207403"], ["updated_at", "2015-04-03 08:26:21.207403"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (7) [refresh_token] Token still valid (7) [refresh_token] Token requested (7)  (0.1ms) rollback transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963181"], ["created_at", "2015-04-03 08:26:21.214547"], ["updated_at", "2015-04-03 08:26:21.214547"]]  (2.1ms) commit transaction [refresh_token] Token requested (7) [refresh_token] Token expired, requesting a refresh... (7) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (7)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) 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", "1428222381"], ["updated_at", "2015-04-03 08:26:21.219709"], ["id", 7]]  (1.5ms) commit transaction [refresh_token] Token update successful (7) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 7]]  (1.7ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963181"], ["created_at", "2015-04-03 08:26:21.228959"], ["updated_at", "2015-04-03 08:26:21.228959"]]  (1.6ms) commit transaction [refresh_token] Token requested (8) [refresh_token] Token expired, requesting a refresh... (8) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (8)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.1ms) 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", "1428222381"], ["updated_at", "2015-04-03 08:26:21.232516"], ["id", 8]]  (1.0ms) commit transaction [refresh_token] Token update successful (8) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 8]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 8]]  (1.3ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-04-03 08:26:21.243260"], ["updated_at", "2015-04-03 08:26:21.243260"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2015-04-03 08:26:21.249649"], ["updated_at", "2015-04-03 08:26:21.249649"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 9) LIMIT 1 SQL (0.1ms) 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-04-03 08:26:21.251364"], ["id", 9]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 9]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.253655"], ["updated_at", "2015-04-03 08:26:21.253655"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:26:21.255034"], ["updated_at", "2015-04-03 08:26:21.255034"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) 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-04-03 08:26:21.256826"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.259209"], ["updated_at", "2015-04-03 08:26:21.259209"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:26:21.260555"], ["updated_at", "2015-04-03 08:26:21.260555"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) 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-04-03 08:26:21.262482"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.264530"], ["updated_at", "2015-04-03 08:26:21.264530"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:26:21.266121"], ["updated_at", "2015-04-03 08:26:21.266121"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.0ms) 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-04-03 08:26:21.267833"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.269864"], ["updated_at", "2015-04-03 08:26:21.269864"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.273050"], ["updated_at", "2015-04-03 08:26:21.273050"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.275264"], ["updated_at", "2015-04-03 08:26:21.275264"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.276902"], ["updated_at", "2015-04-03 08:26:21.276902"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.279094"], ["updated_at", "2015-04-03 08:26:21.279094"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.280821"], ["updated_at", "2015-04-03 08:26:21.280821"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:21.283015"], ["updated_at", "2015-04-03 08:26:21.283015"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.284719"], ["updated_at", "2015-04-03 08:26:21.284719"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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 3ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.308197"], ["updated_at", "2015-04-03 08:26:21.308197"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.312898"], ["updated_at", "2015-04-03 08:26:21.312898"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:21.317331"], ["updated_at", "2015-04-03 08:26:21.317331"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.735395"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.735395"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 15ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.739944"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.739944"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.744252"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.744252"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.750279"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.750279"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.753042"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.753042"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.755265"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.755265"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.756696"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.756696"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.758612"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.758612"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.760094"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.760094"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.761794"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.761794"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.763847"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.763847"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.765737"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.765737"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.766934"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.766934"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:26:53.768921"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.771062"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.771062"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.772166"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.772166"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:26:53.773651"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.775728"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:26:53.775728"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.776848"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.776848"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:26:53.778574"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.2ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.781182"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963213"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.781182"]]  (2.1ms) commit transaction [refresh_token] Token requested (9) [refresh_token] Token expired, requesting a refresh... (9) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (9)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 9 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222413"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:26:53.785212"]]  (1.3ms) commit transaction [refresh_token] Token update successful (9) Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 9]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 9]]  (0.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.790779"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963213"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.790779"]]  (1.5ms) commit transaction [refresh_token] Token requested (10) [refresh_token] Token expired, requesting a refresh... (10) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (10)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222413"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:26:53.794182"]]  (1.4ms) commit transaction [refresh_token] Token update successful (10) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 10]]  (1.7ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.800675"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428136013], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:26:53.800675"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (11) [refresh_token] Token still valid (11) [refresh_token] Token requested (11)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:26:53.802681"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:26:53.802681"]]  (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"."uid" IS NULL AND "accounts"."id" != 11) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 11 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:26:53.803813"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 11]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-03 08:26:53.807669"], ["uid", 0], ["updated_at", "2015-04-03 08:26:53.807669"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.366315"], ["updated_at", "2015-04-03 08:26:58.366315"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 24ms (ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.371939"], ["updated_at", "2015-04-03 08:26:58.371939"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.376450"], ["updated_at", "2015-04-03 08:26:58.376450"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.397320"], ["updated_at", "2015-04-03 08:26:58.397320"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:26:58.398946"], ["updated_at", "2015-04-03 08:26:58.398946"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) 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-04-03 08:26:58.401590"], ["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.403870"], ["updated_at", "2015-04-03 08:26:58.403870"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:26:58.405168"], ["updated_at", "2015-04-03 08:26:58.405168"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.0ms) 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-04-03 08:26:58.407069"], ["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.409855"], ["updated_at", "2015-04-03 08:26:58.409855"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:26:58.411403"], ["updated_at", "2015-04-03 08:26:58.411403"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.0ms) 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-04-03 08:26:58.413195"], ["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.415541"], ["updated_at", "2015-04-03 08:26:58.415541"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.418947"], ["updated_at", "2015-04-03 08:26:58.418947"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.421373"], ["updated_at", "2015-04-03 08:26:58.421373"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.423187"], ["updated_at", "2015-04-03 08:26:58.423187"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.425052"], ["updated_at", "2015-04-03 08:26:58.425052"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.426893"], ["updated_at", "2015-04-03 08:26:58.426893"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:26:58.428492"], ["updated_at", "2015-04-03 08:26:58.428492"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:26:58.430485"], ["updated_at", "2015-04-03 08:26:58.430485"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) 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-04-03 08:26:58.432665"], ["updated_at", "2015-04-03 08:26:58.432665"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 11) LIMIT 1 SQL (0.1ms) 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-04-03 08:26:58.433898"], ["id", 11]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 11]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-04-03 08:26:58.438189"], ["updated_at", "2015-04-03 08:26:58.438189"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428136018"], ["created_at", "2015-04-03 08:26:58.447119"], ["updated_at", "2015-04-03 08:26:58.447119"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (11) [refresh_token] Token still valid (11) [refresh_token] Token requested (11)  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963218"], ["created_at", "2015-04-03 08:26:58.449351"], ["updated_at", "2015-04-03 08:26:58.449351"]]  (1.7ms) commit transaction [refresh_token] Token requested (11) [refresh_token] Token expired, requesting a refresh... (11) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (11)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.1ms) 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", "1428222418"], ["updated_at", "2015-04-03 08:26:58.453778"], ["id", 11]]  (1.8ms) commit transaction [refresh_token] Token update successful (11) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 11]]  (2.2ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963218"], ["created_at", "2015-04-03 08:26:58.461106"], ["updated_at", "2015-04-03 08:26:58.461106"]]  (1.9ms) commit transaction [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) 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", "1428222418"], ["updated_at", "2015-04-03 08:26:58.464903"], ["id", 12]]  (1.5ms) commit transaction [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.573816"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963245"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.573816"]]  (1.7ms) commit transaction [refresh_token] Token requested (13) [refresh_token] Token expired, requesting a refresh... (13) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (13)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 13 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222445"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:27:25.578440"]]  (1.8ms) commit transaction [refresh_token] Token update successful (13) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 13]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 13]]  (2.2ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.588110"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427963245"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.588110"]]  (1.4ms) commit transaction [refresh_token] Token requested (14) [refresh_token] Token expired, requesting a refresh... (14) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (14)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 14 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428222445"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 08:27:25.591480"]]  (1.5ms) commit transaction [refresh_token] Token update successful (14) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 14]]  (1.6ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.597724"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428136045], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.597724"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (15) [refresh_token] Token still valid (15) [refresh_token] Token requested (15)  (0.1ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.602795"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.602795"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.606642"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.606642"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.608844"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.608844"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.610507"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.610507"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.612403"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.612403"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.614045"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.614045"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.616110"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.616110"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.617779"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.617779"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.619805"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.619805"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.620896"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.620896"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:27:25.622813"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.624912"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.624912"]]  (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"."uid" = 123 LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.626280"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.626280"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:27:25.627731"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 16]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.629743"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 08:27:25.629743"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.630885"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.630885"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 16 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 08:27:25.632350"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 16]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.634428"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 08:27:25.634428"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 15) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 15 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 08:27:25.635535"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 15]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-03 08:27:25.639798"], ["uid", 0], ["updated_at", "2015-04-03 08:27:25.639798"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.665873"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.665873"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.669478"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.669478"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 08:27:25.672903"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 08:27:25.672903"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.5ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) 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-04-03 08:27:27.280211"], ["updated_at", "2015-04-03 08:27:27.280211"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 15) LIMIT 1 SQL (0.1ms) 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-04-03 08:27:27.282131"], ["id", 15]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 15]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428136047"], ["created_at", "2015-04-03 08:27:27.286503"], ["updated_at", "2015-04-03 08:27:27.286503"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (15) [refresh_token] Token still valid (15) [refresh_token] Token requested (15)  (0.1ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963247"], ["created_at", "2015-04-03 08:27:27.293585"], ["updated_at", "2015-04-03 08:27:27.293585"]]  (1.8ms) commit transaction [refresh_token] Token requested (15) [refresh_token] Token expired, requesting a refresh... (15) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (15)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.1ms) 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", "1428222447"], ["updated_at", "2015-04-03 08:27:27.298600"], ["id", 15]]  (1.3ms) commit transaction [refresh_token] Token update successful (15) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 15]]  (1.2ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427963247"], ["created_at", "2015-04-03 08:27:27.305571"], ["updated_at", "2015-04-03 08:27:27.305571"]]  (1.3ms) commit transaction [refresh_token] Token requested (16) [refresh_token] Token expired, requesting a refresh... (16) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (16)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.1ms) 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", "1428222447"], ["updated_at", "2015-04-03 08:27:27.308762"], ["id", 16]]  (1.5ms) commit transaction [refresh_token] Token update successful (16) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 16]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 16]]  (1.0ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-04-03 08:27:27.319834"], ["updated_at", "2015-04-03 08:27:27.319834"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.325864"], ["updated_at", "2015-04-03 08:27:27.325864"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:27:27.327523"], ["updated_at", "2015-04-03 08:27:27.327523"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) 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-04-03 08:27:27.329431"], ["id", 18]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.332182"], ["updated_at", "2015-04-03 08:27:27.332182"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:27:27.333539"], ["updated_at", "2015-04-03 08:27:27.333539"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) 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-04-03 08:27:27.335439"], ["id", 18]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 18]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.337592"], ["updated_at", "2015-04-03 08:27:27.337592"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 08:27:27.339021"], ["updated_at", "2015-04-03 08:27:27.339021"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) 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-04-03 08:27:27.340919"], ["id", 18]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 18]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.343165"], ["updated_at", "2015-04-03 08:27:27.343165"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.349544"], ["updated_at", "2015-04-03 08:27:27.349544"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.352103"], ["updated_at", "2015-04-03 08:27:27.352103"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.353815"], ["updated_at", "2015-04-03 08:27:27.353815"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.355979"], ["updated_at", "2015-04-03 08:27:27.355979"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.357470"], ["updated_at", "2015-04-03 08:27:27.357470"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 08:27:27.359473"], ["updated_at", "2015-04-03 08:27:27.359473"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.361226"], ["updated_at", "2015-04-03 08:27:27.361226"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Rendered text template (0.5ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.385698"], ["updated_at", "2015-04-03 08:27:27.385698"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.390170"], ["updated_at", "2015-04-03 08:27:27.390170"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 08:27:27.395491"], ["updated_at", "2015-04-03 08:27:27.395491"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 09:47:30.017653"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427968050"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 09:47:30.017653"]]  (4.2ms) commit transaction [refresh_token] Token requested (17) [refresh_token] Token expired, requesting a refresh... (17) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (17)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 17 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428227250"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 09:47:30.024902"]]  (1.5ms) commit transaction [refresh_token] Token update successful (17) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 17]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 17]]  (2.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 09:47:42.897854"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427968062"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 09:47:42.897854"]]  (1.9ms) commit transaction [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428227262"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 09:47:42.902943"]]  (1.6ms) commit transaction [refresh_token] Token update successful (18) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 18]]  (0.2ms) commit transaction SQLite3::SQLException: cannot commit - no transaction is active: commit transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 18]]  (1.7ms) commit transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 09:48:51.769531"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427968131"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 09:48:51.769531"]] [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428227331"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 09:48:51.772234"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 19  (0.0ms) rollback transaction  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:01:09.499984"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427968869"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:01:09.499984"]]  (1.8ms) commit transaction [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.2ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428228069"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:01:09.504443"]]  (2.2ms) commit transaction [refresh_token] Token update successful (19) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 19]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 19]]  (1.4ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427968871"], ["created_at", "2015-04-03 10:01:11.174560"], ["updated_at", "2015-04-03 10:01:11.174560"]]  (1.7ms) commit transaction [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.1ms) 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", "1428228071"], ["updated_at", "2015-04-03 10:01:11.179741"], ["id", 20]]  (1.7ms) commit transaction [refresh_token] Token update successful (20) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 20]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 20]]  (1.7ms) commit transaction  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)   (0.1ms) select sqlite_version(*)  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateAccounts (20140522110326)  (0.0ms) begin transaction  (0.2ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110326"]]  (1.3ms) commit transaction Migrating to AddOAuthFieldsToAccounts (20140522110454)  (0.0ms) begin transaction  (0.2ms) ALTER TABLE "accounts" ADD "provider" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "uid" integer  (0.1ms) CREATE INDEX "index_accounts_on_uid" ON "accounts" ("uid")  (0.1ms) ALTER TABLE "accounts" ADD "name" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_access_token" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_refresh_token" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_expires_at" varchar(255) SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110454"]]  (3.1ms) commit transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_accounts_on_uid' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_accounts_on_uid' AND type='index'  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:19:16.921535"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427969956"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:19:16.921535"]]  (2.0ms) commit transaction [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229156"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:19:16.927120"]]  (1.8ms) commit transaction [refresh_token] Token update successful (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.7ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427969958"], ["created_at", "2015-04-03 10:19:18.535979"], ["updated_at", "2015-04-03 10:19:18.535979"]]  (1.8ms) commit transaction [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1428229158"], ["updated_at", "2015-04-03 10:19:18.540745"], ["id", 2]]  (1.4ms) commit transaction [refresh_token] Token update successful (2) Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.6ms) commit transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:19:29.910844"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427969969"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:19:29.910844"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229169"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:19:29.913577"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:21:43.234541"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970103"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:21:43.234541"]]  (1.9ms) commit transaction [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229303"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:21:43.239489"]]  (1.3ms) commit transaction [refresh_token] Token update successful (3) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (1.7ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970104"], ["created_at", "2015-04-03 10:21:44.858989"], ["updated_at", "2015-04-03 10:21:44.858989"]]  (1.7ms) commit transaction [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1428229304"], ["updated_at", "2015-04-03 10:21:44.863790"], ["id", 4]]  (1.5ms) commit transaction [refresh_token] Token update successful (4) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (2.0ms) commit transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:21:50.898722"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970110"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:21:50.898722"]]  (1.8ms) commit transaction [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229310"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:21:50.904696"]]  (1.7ms) commit transaction [refresh_token] Token update successful (5) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (1.2ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970112"], ["created_at", "2015-04-03 10:21:52.520619"], ["updated_at", "2015-04-03 10:21:52.520619"]]  (1.9ms) commit transaction [refresh_token] Token requested (6) [refresh_token] Token expired, requesting a refresh... (6) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (6)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) 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", "1428229312"], ["updated_at", "2015-04-03 10:21:52.525786"], ["id", 6]]  (1.4ms) commit transaction [refresh_token] Token update successful (6) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (2.0ms) commit transaction  (0.2ms) BEGIN TRANSACTION; END;  (0.1ms) begin transaction SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:24:16.928939"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970256"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:24:16.928939"]]  (2.0ms) commit transaction [refresh_token] Token requested (7) [refresh_token] Token expired, requesting a refresh... (7) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (7)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229456"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:24:16.933597"]]  (1.8ms) commit transaction [refresh_token] Token update successful (7) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 7]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 7]]  (1.8ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:24:54.473852"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970294"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:24:54.473852"]]  (1.6ms) commit transaction [refresh_token] Token requested (8) [refresh_token] Token expired, requesting a refresh... (8) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (8)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 8 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229494"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:24:54.478915"]]  (1.4ms) commit transaction [refresh_token] Token update successful (8) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 8]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 8]]  (1.3ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970296"], ["created_at", "2015-04-03 10:24:56.096046"], ["updated_at", "2015-04-03 10:24:56.096046"]]  (1.9ms) commit transaction [refresh_token] Token requested (9) [refresh_token] Token expired, requesting a refresh... (9) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (9)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.1ms) 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", "1428229496"], ["updated_at", "2015-04-03 10:24:56.101211"], ["id", 9]]  (1.6ms) commit transaction [refresh_token] Token update successful (9) Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 9]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 9]]  (1.7ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:25:14.075511"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970314"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:25:14.075511"]]  (1.7ms) commit transaction [refresh_token] Token requested (10) [refresh_token] Token expired, requesting a refresh... (10) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (10)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229514"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:25:14.079632"]]  (1.2ms) commit transaction [refresh_token] Token update successful (10) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 10]]  (1.3ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970315"], ["created_at", "2015-04-03 10:25:15.679422"], ["updated_at", "2015-04-03 10:25:15.679422"]]  (1.5ms) commit transaction [refresh_token] Token requested (11) [refresh_token] Token expired, requesting a refresh... (11) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (11)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.1ms) 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", "1428229515"], ["updated_at", "2015-04-03 10:25:15.683655"], ["id", 11]]  (2.1ms) commit transaction [refresh_token] Token update successful (11) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 11]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 11]]  (1.8ms) commit transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:25:47.034467"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970347"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:25:47.034467"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229547"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:25:47.037711"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970348"], ["created_at", "2015-04-03 10:25:48.645726"], ["updated_at", "2015-04-03 10:25:48.645726"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) 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", "1428229548"], ["updated_at", "2015-04-03 10:25:48.648822"], ["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:26:04.111021"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970364"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:26:04.111021"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.7ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229564"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:26:04.113435"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.6ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970365"], ["created_at", "2015-04-03 10:26:05.731661"], ["updated_at", "2015-04-03 10:26:05.731661"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) 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", "1428229565"], ["updated_at", "2015-04-03 10:26:05.734074"], ["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:27:18.263510"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970438"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:27:18.263510"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229638"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:27:18.265768"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970439"], ["created_at", "2015-04-03 10:27:19.933141"], ["updated_at", "2015-04-03 10:27:19.933141"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) 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", "1428229639"], ["updated_at", "2015-04-03 10:27:19.935771"], ["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:27:46.160928"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970466"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:27:46.160928"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229666"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:27:46.163707"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:28:17.989436"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970497"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:28:17.989436"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229697"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:28:17.991972"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:30:25.722593"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970625"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:30:25.722593"]] [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12) Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229825"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:30:25.724742"]] [refresh_token] Token update successful (12)  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) rollback transaction  (1.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:30:55.304399"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970655"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:30:55.304399"]] [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12) Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229855"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:30:55.306268"]] [refresh_token] Token update successful (12)  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) rollback transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970678"], ["created_at", "2015-04-03 10:31:18.324743"], ["updated_at", "2015-04-03 10:31:18.324743"]] [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12) Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) 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", "1428229878"], ["updated_at", "2015-04-03 10:31:18.327063"], ["id", 12]] [refresh_token] Token update successful (12)  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:31:22.627992"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970682"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:31:22.627992"]] [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12) Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229882"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:31:22.630892"]] [refresh_token] Token update successful (12)  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.2ms) begin transaction Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970723"], ["created_at", "2015-04-03 10:32:03.331449"], ["updated_at", "2015-04-03 10:32:03.331449"]] [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12) Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) 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", "1428229923"], ["updated_at", "2015-04-03 10:32:03.333722"], ["id", 12]] [refresh_token] Token update successful (12)  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.3ms) begin transaction Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:32:27.360439"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970747"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:32:27.360439"]] [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229947"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:32:27.363076"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12  (0.0ms) rollback transaction  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:32:59.327758"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970779"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:32:59.327758"]]  (2.0ms) commit transaction [refresh_token] Token requested (12) [refresh_token] Token expired, requesting a refresh... (12) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (12)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 12 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428229979"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:32:59.332661"]]  (1.7ms) commit transaction [refresh_token] Token update successful (12) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 12]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 12]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970780"], ["created_at", "2015-04-03 10:33:00.997145"], ["updated_at", "2015-04-03 10:33:00.997145"]]  (1.3ms) commit transaction [refresh_token] Token requested (13) [refresh_token] Token expired, requesting a refresh... (13) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (13)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) 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", "1428229981"], ["updated_at", "2015-04-03 10:33:01.002465"], ["id", 13]]  (2.6ms) commit transaction [refresh_token] Token update successful (13) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 13]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 13]]  (1.3ms) commit transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.834411"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.834411"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.839813"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.839813"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.843170"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.843170"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.862189"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-03 10:34:55.862189"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 14) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 14 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-03 10:34:55.863985"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 14]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-03 10:34:55.868338"], ["uid", 0], ["updated_at", "2015-04-03 10:34:55.868338"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.874473"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970895"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.874473"]]  (1.9ms) commit transaction [refresh_token] Token requested (14) [refresh_token] Token expired, requesting a refresh... (14) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (14)  (0.3ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 14 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428230095"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:34:55.878643"]]  (1.1ms) commit transaction [refresh_token] Token update successful (14) Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 14]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 14]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.884536"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970895"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.884536"]]  (1.3ms) commit transaction [refresh_token] Token requested (15) [refresh_token] Token expired, requesting a refresh... (15) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (15)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 15 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428230095"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:34:55.887409"]]  (1.0ms) commit transaction [refresh_token] Token update successful (15) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 15]]  (1.4ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.892853"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428143695], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.892853"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (16) [refresh_token] Token still valid (16) [refresh_token] Token requested (16)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.895115"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.895115"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.898416"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.898416"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.900731"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.900731"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.902438"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.902438"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.904174"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.904174"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.905824"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.905824"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.907453"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.907453"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.909004"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.909004"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.910837"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.910837"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.912020"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.912020"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 10:34:55.913681"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.915338"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.915338"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.916419"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.916419"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 10:34:55.917857"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 17]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.919929"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-03 10:34:55.919929"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-03 10:34:55.921043"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-03 10:34:55.921043"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 17 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-03 10:34:55.922626"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 17]]  (0.2ms) rollback transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428143697"], ["created_at", "2015-04-03 10:34:57.520328"], ["updated_at", "2015-04-03 10:34:57.520328"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (16) [refresh_token] Token still valid (16) [refresh_token] Token requested (16)  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970897"], ["created_at", "2015-04-03 10:34:57.526555"], ["updated_at", "2015-04-03 10:34:57.526555"]]  (1.5ms) commit transaction [refresh_token] Token requested (16) [refresh_token] Token expired, requesting a refresh... (16) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (16)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.1ms) 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", "1428230097"], ["updated_at", "2015-04-03 10:34:57.531026"], ["id", 16]]  (2.9ms) commit transaction [refresh_token] Token update successful (16) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 16]]  (1.5ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1427970897"], ["created_at", "2015-04-03 10:34:57.542183"], ["updated_at", "2015-04-03 10:34:57.542183"]]  (1.6ms) commit transaction [refresh_token] Token requested (17) [refresh_token] Token expired, requesting a refresh... (17) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (17)  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.1ms) 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", "1428230097"], ["updated_at", "2015-04-03 10:34:57.545634"], ["id", 17]]  (1.6ms) commit transaction [refresh_token] Token update successful (17) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 17]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 17]]  (1.3ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested () [refresh_token] Token still valid ()  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.555434"], ["updated_at", "2015-04-03 10:34:57.555434"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 10:34:57.556838"], ["updated_at", "2015-04-03 10:34:57.556838"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) 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-04-03 10:34:57.558962"], ["id", 19]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.561161"], ["updated_at", "2015-04-03 10:34:57.561161"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 10:34:57.562754"], ["updated_at", "2015-04-03 10:34:57.562754"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) 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-04-03 10:34:57.564568"], ["id", 19]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 19]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.566789"], ["updated_at", "2015-04-03 10:34:57.566789"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-03 10:34:57.568097"], ["updated_at", "2015-04-03 10:34:57.568097"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.0ms) 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-04-03 10:34:57.569725"], ["id", 19]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 19]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.572067"], ["updated_at", "2015-04-03 10:34:57.572067"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.575315"], ["updated_at", "2015-04-03 10:34:57.575315"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.577606"], ["updated_at", "2015-04-03 10:34:57.577606"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.580139"], ["updated_at", "2015-04-03 10:34:57.580139"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.582122"], ["updated_at", "2015-04-03 10:34:57.582122"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.583789"], ["updated_at", "2015-04-03 10:34:57.583789"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-03 10:34:57.585662"], ["updated_at", "2015-04-03 10:34:57.585662"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.587599"], ["updated_at", "2015-04-03 10:34:57.587599"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) 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-04-03 10:34:57.589507"], ["updated_at", "2015-04-03 10:34:57.589507"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 18) LIMIT 1 SQL (0.1ms) 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-04-03 10:34:57.590929"], ["id", 18]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 18]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-04-03 10:34:57.595141"], ["updated_at", "2015-04-03 10:34:57.595141"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 2ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.5ms) Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.634179"], ["updated_at", "2015-04-03 10:34:57.634179"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.639426"], ["updated_at", "2015-04-03 10:34:57.639426"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-03 10:34:57.644358"], ["updated_at", "2015-04-03 10:34:57.644358"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-03 10:36:01.481649"], ["oauth_access_token", "token"], ["oauth_expires_at", "1427970961"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-03 10:36:01.481649"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428230161"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-03 10:36:01.485358"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 18  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 18]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:41:02.856566"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428320462"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:41:02.856566"]]  (1.9ms) commit transaction [refresh_token] Token requested (18) [refresh_token] Token expired, requesting a refresh... (18) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (18)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 18 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428579662"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:41:02.861471"]]  (1.3ms) commit transaction [refresh_token] Token update successful (18) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 18]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 18]]  (2.0ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428320464"], ["created_at", "2015-04-07 11:41:04.525103"], ["updated_at", "2015-04-07 11:41:04.525103"]]  (1.6ms) commit transaction [refresh_token] Token requested (19) [refresh_token] Token expired, requesting a refresh... (19) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (19)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) 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", "1428579664"], ["updated_at", "2015-04-07 11:41:04.530123"], ["id", 19]]  (1.4ms) commit transaction [refresh_token] Token update successful (19) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 19]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts" [1m (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 19]]  (1.4ms) commit transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:41:12.426223"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428320472"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:41:12.426223"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428579672"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:41:12.428901"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 20  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 20]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:41:48.603966"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428320508"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:41:48.603966"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (20) [refresh_token] Token expired, requesting a refresh... (20) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (20)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428579708"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:41:48.607132"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 20  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 20]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts" SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts"  (0.0ms) rollback transaction  (2.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)   (0.1ms) select sqlite_version(*)  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateAccounts (20140522110326)  (0.0ms) begin transaction  (0.2ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110326"]]  (1.3ms) commit transaction Migrating to AddOAuthFieldsToAccounts (20140522110454)  (0.1ms) begin transaction  (0.2ms) ALTER TABLE "accounts" ADD "provider" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "uid" integer  (0.1ms) CREATE INDEX "index_accounts_on_uid" ON "accounts" ("uid")  (0.1ms) ALTER TABLE "accounts" ADD "name" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_access_token" varchar(255)  (0.2ms) ALTER TABLE "accounts" ADD "oauth_refresh_token" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_expires_at" varchar(255) SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110454"]]  (2.4ms) commit transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_accounts_on_uid' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_accounts_on_uid' AND type='index'  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:43:02.600594"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428320582"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:43:02.600594"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428579782"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:43:02.603516"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts"  (0.0ms) rollback transaction  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)   (0.1ms) select sqlite_version(*)  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateAccounts (20140522110326)  (0.0ms) begin transaction  (0.2ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110326"]]  (1.2ms) commit transaction Migrating to AddOAuthFieldsToAccounts (20140522110454)  (0.0ms) begin transaction  (0.2ms) ALTER TABLE "accounts" ADD "provider" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "uid" integer  (0.1ms) CREATE INDEX "index_accounts_on_uid" ON "accounts" ("uid")  (0.1ms) ALTER TABLE "accounts" ADD "name" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_access_token" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_refresh_token" varchar(255)  (0.1ms) ALTER TABLE "accounts" ADD "oauth_expires_at" varchar(255) SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110454"]]  (3.3ms) commit transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_accounts_on_uid' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_accounts_on_uid' AND type='index'  (0.7ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:44:45.159600"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428320685"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:44:45.159600"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428579885"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:44:45.162448"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:44:55.829221"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428320695"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:44:55.829221"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428579895"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:44:55.832015"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:51:38.526866"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321098"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:51:38.526866"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428580298"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:51:38.529560"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.7ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:54:52.145708"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321292"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:54:52.145708"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428580492"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 11:54:52.148548"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:56:00.910214"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321360"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:56:00.910214"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:57:09.156174"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321412"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:57:09.156174"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token requested (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:57:53.659554"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321472"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:57:53.659554"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) [refresh_token] Token update failed (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:58:47.219380"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321526"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:58:47.219380"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update failed (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:59:10.634504"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321547"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:59:10.634504"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" [refresh_token] Token update failed (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:59:32.091360"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321570"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:59:32.091360"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 11:59:50.227329"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321589"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 11:59:50.227329"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:00:19.411959"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321618"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:00:19.411959"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428580819"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:01:10.220870"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428580819"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:01:10.220870"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:01:20.123788"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321679"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:01:20.123788"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428580880"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:01:22.067318"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:02:50.700952"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321769"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:02:50.700952"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.3ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428580970"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:02:52.163845"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:03:50.148018"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428321828"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:03:50.148018"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1  (0.0ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1  (0.0ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "provider" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["provider", "hhh"], ["updated_at", "2015-04-07 12:04:45.028378"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "provider" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "provider" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["provider", "hhh"], ["updated_at", "2015-04-07 12:04:45.028378"]]  (0.0ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1  (0.0ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428581030"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:06:35.594939"]]  (0.0ms) commit transaction [refresh_token] Token update successful (1) Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:07:53.628716"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428322072"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:07:53.628716"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428581273"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:07:59.740138"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:08:25.739520"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428322105"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:08:25.739520"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428581305"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:08:51.252286"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (1.4ms) SELECT "accounts".* FROM "accounts"  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:09:04.541605"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428322134"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:09:04.541605"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428581344"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:09:18.100121"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (3.2ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:23:18.388803"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428322993"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:23:18.388803"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582198"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:23:20.164472"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:24:15.396639"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323054"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:24:15.396639"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582255"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:24:22.220308"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:24:32.364331"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323071"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:24:32.364331"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582272"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:24:35.516431"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:24:56.830054"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323093"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:24:56.830054"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582296"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:25:00.572953"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:25:49.244551"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323148"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:25:49.244551"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582349"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:25:51.660779"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:26:44.781545"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323195"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:26:44.781545"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582404"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:26:50.052869"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:27:44.084754"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323263"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:27:44.084754"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582464"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:27:52.140077"]]  (0.0ms) commit transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:28:28.244893"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323306"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:28:28.244893"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582508"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:28:29.565072"]]  (0.0ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:28:42.845249"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323320"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:28:42.845249"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582522"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:28:44.613468"]]  (0.0ms) commit transaction [refresh_token] Token update successful (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 12:29:53.988720"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428323393"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 12:29:53.988720"]]  (1.9ms) commit transaction [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428582593"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 12:29:53.993469"]]  (1.3ms) commit transaction [refresh_token] Token update successful (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.3ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428323395"], ["created_at", "2015-04-07 12:29:55.623944"], ["updated_at", "2015-04-07 12:29:55.623944"]]  (1.9ms) commit transaction [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1428582595"], ["updated_at", "2015-04-07 12:29:55.629144"], ["id", 2]]  (1.2ms) commit transaction [refresh_token] Token update successful (2) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:32:35.221678"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327155"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:32:35.221678"]]  (1.4ms) commit transaction [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428586355"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:32:35.225840"]]  (1.5ms) commit transaction [refresh_token] Token update successful (3) Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (2.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428327156"], ["created_at", "2015-04-07 13:32:36.840536"], ["updated_at", "2015-04-07 13:32:36.840536"]]  (1.8ms) commit transaction [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1428586356"], ["updated_at", "2015-04-07 13:32:36.846926"], ["id", 4]]  (2.2ms) commit transaction [refresh_token] Token update successful (4) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (1.7ms) commit transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:32:53.831704"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327173"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:32:53.831704"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428586373"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:32:53.835031"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.4ms) begin transaction Account Load (0.5ms) SELECT "accounts".* FROM "accounts"  (0.0ms) rollback transaction  (0.2ms) begin transaction Account Load (0.5ms) SELECT "accounts".* FROM "accounts"  (0.0ms) rollback transaction  (0.2ms) begin transaction Account Load (0.6ms) SELECT "accounts".* FROM "accounts"  (0.0ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:42:57.511663"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327777"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:42:57.511663"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428586977"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:42:57.514593"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:44:05.324854"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327845"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:44:05.324854"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587045"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:44:05.327724"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:44:30.641891"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327870"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:44:30.641891"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587070"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:44:30.644397"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:45:08.923100"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327908"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:45:08.923100"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587108"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:45:08.925547"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:45:22.069583"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327922"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:45:22.069583"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587122"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:45:22.072202"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:46:21.131393"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428327981"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:46:21.131393"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587181"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:46:21.134200"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:46:49.877151"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428328009"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:46:49.877151"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587209"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:46:49.879943"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 13:48:15.209664"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428328095"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 13:48:15.209664"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428587295"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 13:48:15.212220"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5  (0.6ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.5ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 14:01:38.419641"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428328898"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 14:01:38.419641"]]  (2.3ms) commit transaction [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428588098"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 14:01:38.424548"]]  (1.3ms) commit transaction [refresh_token] Token update successful (5) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (1.3ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428328900"], ["created_at", "2015-04-07 14:01:40.030628"], ["updated_at", "2015-04-07 14:01:40.030628"]]  (1.8ms) commit transaction [refresh_token] Token requested (6) [refresh_token] Token expired, requesting a refresh... (6) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (6)  (0.1ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) 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", "1428588100"], ["updated_at", "2015-04-07 14:01:40.035655"], ["id", 6]]  (1.5ms) commit transaction [refresh_token] Token update successful (6) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (3.1ms) commit transaction  (0.3ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 14:01:49.489715"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428328909"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 14:01:49.489715"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 [refresh_token] Token requested (7) [refresh_token] Token expired, requesting a refresh... (7) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (7)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428588109"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 14:01:49.492451"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) SAVEPOINT active_record_1 SQL (0.0ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 7]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:37:32.103890"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428334652"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:37:32.103890"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428593852"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:37:32.113849"]]  (0.1ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]  (0.6ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:38:18.692162"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428334698"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:38:18.692162"]]  (0.5ms) COMMIT  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 2 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428593898"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:38:18.702948"]]  (0.4ms) COMMIT Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]]  (0.3ms) COMMIT  (0.3ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428334700"], ["created_at", "2015-04-07 15:38:20.337201"], ["updated_at", "2015-04-07 15:38:20.337201"]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428593900"], ["updated_at", "2015-04-07 15:38:20.351330"], ["id", 3]]  (0.5ms) COMMIT Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]]  (0.4ms) COMMIT  (0.6ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:42:50.871746"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428334970"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:42:50.871746"]]  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594170"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:42:50.881066"]]  (0.1ms) COMMIT  (0.4ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:44:44.085078"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335084"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:44:44.085078"]]  (0.5ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594284"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:44:44.100220"]]  (0.4ms) COMMIT  (0.2ms) COMMIT Account Load (0.6ms) SELECT "accounts".* FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335097"], ["created_at", "2015-04-07 15:44:57.162876"], ["updated_at", "2015-04-07 15:44:57.162876"]]  (0.6ms) COMMIT  (0.1ms) BEGIN  (0.2ms) BEGIN Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594297"], ["updated_at", "2015-04-07 15:44:57.181922"], ["id", 6]]  (0.5ms) COMMIT  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.9ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 6]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:46:20.936358"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335180"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:46:20.936358"]]  (0.5ms) COMMIT  (0.2ms) BEGIN  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 7 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594380"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:46:20.951918"]]  (0.4ms) COMMIT  (0.2ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT 1  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT 1  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.1ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 7]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 7]]  (0.3ms) COMMIT  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335294"], ["created_at", "2015-04-07 15:48:14.691782"], ["updated_at", "2015-04-07 15:48:14.691782"]]  (0.4ms) COMMIT  (0.1ms) BEGIN  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594494"], ["updated_at", "2015-04-07 15:48:14.709614"], ["id", 8]]  (0.5ms) COMMIT Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT 1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 8]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:49:18.407814"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335358"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:49:18.407814"]]  (0.4ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 9 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594558"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:49:18.423330"]]  (0.4ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 9]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 9]]  (0.4ms) COMMIT  (0.1ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335365"], ["created_at", "2015-04-07 15:49:25.431301"], ["updated_at", "2015-04-07 15:49:25.431301"]]  (0.6ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594565"], ["updated_at", "2015-04-07 15:49:25.448921"], ["id", 10]]  (0.7ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 10]]  (0.3ms) COMMIT  (0.1ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:49:37.318885"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335377"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:49:37.318885"]]  (0.4ms) COMMIT  (0.3ms) BEGIN  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 11 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594577"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:49:37.333782"]]  (0.5ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 11]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335378"], ["created_at", "2015-04-07 15:49:38.962282"], ["updated_at", "2015-04-07 15:49:38.962282"]]  (0.4ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 12) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594578"], ["updated_at", "2015-04-07 15:49:38.978938"], ["id", 12]]  (0.4ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 12]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 12]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:49:52.805997"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335392"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:49:52.805997"]]  (0.4ms) COMMIT  (0.1ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 13) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 13 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594592"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:49:52.813064"]]  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 13]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 13]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:50:04.215538"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335404"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:50:04.215538"]]  (0.5ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 14) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 14 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594604"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:50:04.230470"]]  (0.4ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 14]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.4ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 14]]  (0.5ms) COMMIT  (0.3ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335405"], ["created_at", "2015-04-07 15:50:05.869645"], ["updated_at", "2015-04-07 15:50:05.869645"]]  (0.6ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 15) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594605"], ["updated_at", "2015-04-07 15:50:05.887238"], ["id", 15]]  (0.6ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 15]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 15]]  (1.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:50:27.866476"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335427"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:50:27.866476"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.2ms) BEGIN Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 16) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 16 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594627"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:50:27.880554"]]  (0.2ms) COMMIT  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 16]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:50:55.610603"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335455"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:50:55.610603"]]  (0.5ms) COMMIT  (0.3ms) BEGIN  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 17) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 17 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594655"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:50:55.625204"]]  (0.5ms) COMMIT  (0.1ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 17]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 17]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335457"], ["created_at", "2015-04-07 15:50:57.250691"], ["updated_at", "2015-04-07 15:50:57.250691"]]  (0.4ms) COMMIT  (0.2ms) BEGIN  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 18) LIMIT 1 SQL (0.7ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594657"], ["updated_at", "2015-04-07 15:50:57.267094"], ["id", 18]]  (0.4ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]] Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 18]]  (0.4ms) COMMIT  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:53:32.264366"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335612"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:53:32.264366"]]  (0.5ms) COMMIT  (0.1ms) BEGIN Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 19) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 19 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594812"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:53:32.271838"]]  (0.2ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]]  (0.3ms) COMMIT  (0.3ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2015-04-07 15:53:38.369981"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335618"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:53:38.369981"]]  (0.4ms) COMMIT  (0.1ms) BEGIN  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 20) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_expires_at" = $2, "oauth_refresh_token" = $3, "updated_at" = $4 WHERE "accounts"."id" = 20 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594818"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:53:38.384776"]]  (0.6ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.1ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]]  (0.3ms) COMMIT  (0.2ms) BEGIN Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335620"], ["created_at", "2015-04-07 15:53:40.021129"], ["updated_at", "2015-04-07 15:53:40.021129"]]  (0.5ms) COMMIT  (0.1ms) BEGIN  (0.2ms) BEGIN Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 21) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428594820"], ["updated_at", "2015-04-07 15:53:40.038549"], ["id", 21]]  (0.5ms) COMMIT  (0.2ms) ROLLBACK Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 21]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.2ms) BEGIN SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]]  (0.4ms) COMMIT  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 15:55:51.408376"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335751"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:55:51.408376"]]  (2.0ms) commit transaction [refresh_token] Token requested (1) [refresh_token] Token expired, requesting a refresh... (1) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (1)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594951"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:55:51.413818"]]  (1.5ms) commit transaction [refresh_token] Token update successful (1) Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (2.1ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335753"], ["created_at", "2015-04-07 15:55:53.045520"], ["updated_at", "2015-04-07 15:55:53.045520"]]  (1.8ms) commit transaction [refresh_token] Token requested (2) [refresh_token] Token expired, requesting a refresh... (2) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (2)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1428594953"], ["updated_at", "2015-04-07 15:55:53.051142"], ["id", 2]]  (2.7ms) commit transaction [refresh_token] Token update successful (2) Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.9ms) commit transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 15:56:16.980631"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335776"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:56:16.980631"]] [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594976"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:56:16.983521"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3  (0.0ms) rollback transaction  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 15:56:26.808445"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335786"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:56:26.808445"]]  (2.2ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested (3) [refresh_token] Token expired, requesting a refresh... (3) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (3)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428594986"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:56:26.817747"]]  (1.6ms) commit transaction [refresh_token] Token update successful (3)  (0.0ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (2.0ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335788"], ["created_at", "2015-04-07 15:56:28.426811"], ["updated_at", "2015-04-07 15:56:28.426811"]]  (1.9ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested (4) [refresh_token] Token expired, requesting a refresh... (4) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (4)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1428594988"], ["updated_at", "2015-04-07 15:56:28.435987"], ["id", 4]]  (3.1ms) commit transaction [refresh_token] Token update successful (4)  (0.0ms) commit transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (1.7ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 15:56:52.989963"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335812"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:56:52.989963"]]  (2.2ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested (5) [refresh_token] Token expired, requesting a refresh... (5) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (5)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595012"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:56:52.999326"]]  (1.4ms) commit transaction [refresh_token] Token update successful (5)  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (1.9ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335814"], ["created_at", "2015-04-07 15:56:54.604729"], ["updated_at", "2015-04-07 15:56:54.604729"]]  (1.8ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested (6) [refresh_token] Token expired, requesting a refresh... (6) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (6)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) 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", "1428595014"], ["updated_at", "2015-04-07 15:56:54.613951"], ["id", 6]]  (2.7ms) commit transaction [refresh_token] Token update successful (6)  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 15:57:05.985009"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335825"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:57:05.985009"]]  (2.0ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested (7) [refresh_token] Token expired, requesting a refresh... (7) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (7) Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595025"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:57:05.993491"]] [refresh_token] Token update successful (7)  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 7]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 7]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 15:57:15.227379"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428335835"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 15:57:15.227379"]]  (1.8ms) commit transaction  (0.1ms) begin transaction [refresh_token] Token requested (8) [refresh_token] Token expired, requesting a refresh... (8) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (8)  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 8 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595035"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 15:57:15.235789"]]  (1.9ms) commit transaction [refresh_token] Token update successful (8)  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 8]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 8]]  (2.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428335836"], ["created_at", "2015-04-07 15:57:16.854173"], ["updated_at", "2015-04-07 15:57:16.854173"]]  (1.8ms) commit transaction  (0.0ms) begin transaction [refresh_token] Token requested (9) [refresh_token] Token expired, requesting a refresh... (9) [refresh_token] Updating local token with refresh_token: refreshed_refresh_token (9)  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) LIMIT 1 SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_refresh_token" = ?, "oauth_expires_at" = ?, "updated_at" = ? WHERE "accounts"."id" = ? [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1428595036"], ["updated_at", "2015-04-07 15:57:16.863397"], ["id", 9]]  (2.0ms) commit transaction [refresh_token] Token update successful (9)  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 9]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 9]]  (1.5ms) commit transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:03:59.509561"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428336239"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:03:59.509561"]]  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 10) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595439"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 16:03:59.512152"]] SQLite3::BusyException: database is locked: UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 10  (0.0ms) rollback transaction  (0.3ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_accounts_on_uid' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_accounts_on_uid' AND type='index'   (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:07:27.252270"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428336447"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:07:27.252270"]]  (2.3ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595647"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 16:07:27.261136"]]  (1.5ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428336448"], ["created_at", "2015-04-07 16:07:28.863250"], ["updated_at", "2015-04-07 16:07:28.863250"]]  (1.8ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1428595648"], ["updated_at", "2015-04-07 16:07:28.871833"], ["id", 2]]  (2.4ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:21.896569"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428336501"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:08:21.896569"]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595701"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 16:08:21.904403"]]  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (1.7ms) commit transaction  (0.4ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:31.077605"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428336511"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:08:31.077605"]]  (1.8ms) commit transaction  (0.0ms) begin transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595711"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 16:08:31.085533"]]  (1.3ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.2ms) begin transaction SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428336512"], ["created_at", "2015-04-07 16:08:32.692392"], ["updated_at", "2015-04-07 16:08:32.692392"]]  (1.6ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 5) LIMIT 1 SQL (1.0ms) 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", "1428595712"], ["updated_at", "2015-04-07 16:08:32.701647"], ["id", 5]]  (3.1ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (1.3ms) commit transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.065865"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.065865"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.071195"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.071195"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.075339"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.075339"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.105558"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.105558"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.108881"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.108881"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.111053"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.111053"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.112501"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.112501"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.114263"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.114263"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.115723"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.115723"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.117389"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.117389"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.118936"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.118936"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.120640"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.120640"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.122105"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.122105"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-07 16:08:38.123805"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.126379"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.126379"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.127491"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.127491"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-07 16:08:38.128916"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 7]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.131103"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-04-07 16:08:38.131103"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.132199"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.132199"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-04-07 16:08:38.134051"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 7]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.136412"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-04-07 16:08:38.136412"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-04-07 16:08:38.137735"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.139859"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428336518"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.139859"]]  (1.5ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595718"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 16:08:38.143711"]]  (1.2ms) commit transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.149762"], ["oauth_access_token", "token"], ["oauth_expires_at", "1428336518"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.149762"]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 7 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1428595718"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-04-07 16:08:38.152870"]]  (1.3ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 7]]  (0.9ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-07 16:08:38.158042"], ["oauth_access_token", "token"], ["oauth_expires_at", 1428509318], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-04-07 16:08:38.158042"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-07 16:08:38.161987"], ["uid", 0], ["updated_at", "2015-04-07 16:08:38.161987"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428509319"], ["created_at", "2015-04-07 16:08:39.764450"], ["updated_at", "2015-04-07 16:08:39.764450"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428336519"], ["created_at", "2015-04-07 16:08:39.766978"], ["updated_at", "2015-04-07 16:08:39.766978"]]  (1.7ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 8) 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", "1428595719"], ["updated_at", "2015-04-07 16:08:39.771793"], ["id", 8]]  (1.5ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 8]]  (1.2ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1428336519"], ["created_at", "2015-04-07 16:08:39.781515"], ["updated_at", "2015-04-07 16:08:39.781515"]]  (1.3ms) commit transaction  (0.0ms) begin transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 9) 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", "1428595719"], ["updated_at", "2015-04-07 16:08:39.784999"], ["id", 9]]  (1.4ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 9]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 9]]  (1.6ms) commit transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-04-07 16:08:39.793712"], ["updated_at", "2015-04-07 16:08:39.793712"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.799241"], ["updated_at", "2015-04-07 16:08:39.799241"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-07 16:08:39.800582"], ["updated_at", "2015-04-07 16:08:39.800582"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) 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-04-07 16:08:39.802566"], ["id", 11]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.804853"], ["updated_at", "2015-04-07 16:08:39.804853"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-07 16:08:39.806279"], ["updated_at", "2015-04-07 16:08:39.806279"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.0ms) 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-04-07 16:08:39.807857"], ["id", 11]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 11]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.809967"], ["updated_at", "2015-04-07 16:08:39.809967"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-04-07 16:08:39.811249"], ["updated_at", "2015-04-07 16:08:39.811249"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 11) LIMIT 1 SQL (0.0ms) 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-04-07 16:08:39.812894"], ["id", 11]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 11]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.815227"], ["updated_at", "2015-04-07 16:08:39.815227"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.821464"], ["updated_at", "2015-04-07 16:08:39.821464"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.823840"], ["updated_at", "2015-04-07 16:08:39.823840"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.825621"], ["updated_at", "2015-04-07 16:08:39.825621"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.827484"], ["updated_at", "2015-04-07 16:08:39.827484"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.829379"], ["updated_at", "2015-04-07 16:08:39.829379"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-04-07 16:08:39.831236"], ["updated_at", "2015-04-07 16:08:39.831236"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.832982"], ["updated_at", "2015-04-07 16:08:39.832982"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) 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-04-07 16:08:39.835002"], ["updated_at", "2015-04-07 16:08:39.835002"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 10) LIMIT 1 SQL (0.1ms) 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-04-07 16:08:39.836377"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.1ms) rollback transaction  (0.0ms) 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 6ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.865768"], ["updated_at", "2015-04-07 16:08:39.865768"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.870378"], ["updated_at", "2015-04-07 16:08:39.870378"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-04-07 16:08:39.875479"], ["updated_at", "2015-04-07 16:08:39.875479"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (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.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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: 2.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.471331"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:03:21.471331"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.7ms) 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", "2015-05-08 12:03:21.473453"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.478243"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173001], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.478243"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.480274"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000201"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.480274"]]  (2.2ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1431259401"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-05-08 12:03:21.489940"]]  (1.5ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.495291"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000201"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.495291"]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1431259401"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-05-08 12:03:21.497669"]]  (0.1ms) rollback transaction Account Load (0.0ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.2ms) commit transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:03:21.503604"], ["uid", 0], ["updated_at", "2015-05-08 12:03:21.503604"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.510221"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.510221"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.511363"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.511363"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:03:21.514217"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.516705"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.516705"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.517886"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.517886"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:03:21.519283"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.521201"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.521201"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.522246"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.522246"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:03:21.523626"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.526343"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.526343"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.529249"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.529249"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.531428"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.531428"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.532847"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.532847"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.534497"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.534497"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.535866"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.535866"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.537442"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:03:21.537442"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.538843"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.538843"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.552853"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.552853"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.556581"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.556581"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:03:21.559793"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:03:21.559793"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.434155"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.434155"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.438869"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.438869"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.442491"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.442491"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:04:39.467482"], ["uid", 0], ["updated_at", "2015-05-08 12:04:39.467482"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.473574"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.473574"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.476977"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.476977"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.479118"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.479118"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.480593"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.480593"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.482381"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.482381"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.483848"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.483848"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.485458"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.485458"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.486939"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.486939"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.488716"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.488716"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.489840"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.489840"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:04:39.491762"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.493968"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.493968"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.494974"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.494974"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:39.496295"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.498139"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:39.498139"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.499207"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.499207"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:39.500627"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.502699"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:04:39.502699"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:39.503740"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.508197"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000279"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.508197"]]  (1.8ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.515610"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000279"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.515610"]]  (1.0ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:39.520738"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173079], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:39.520738"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (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.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.658239"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.658239"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.663064"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.663064"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.667035"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.667035"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.685048"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.685048"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.686386"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.686386"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:04:50.688377"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.690747"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.690747"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.691872"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.691872"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:50.693266"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.695307"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.695307"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.696355"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.696355"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:50.698083"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.700069"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.700069"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.702652"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.702652"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.704653"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.704653"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.706310"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.706310"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.708074"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.708074"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.709621"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.709621"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.711261"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:50.711261"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.712740"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.712740"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:04:50.717098"], ["uid", 0], ["updated_at", "2015-05-08 12:04:50.717098"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.722429"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173090], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.722429"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.724445"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000290"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.724445"]]  (1.7ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.730778"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000290"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:50.730778"]]  (1.3ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.0ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.3ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:50.739210"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:04:50.739210"]]  (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"."uid" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-05-08 12:04:50.740341"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.956366"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.956366"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.961075"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.961075"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.964449"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.964449"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.982543"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:54.982543"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.985591"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.985591"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.987435"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:54.987435"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.988911"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.988911"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.990661"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:54.990661"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.992116"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.992116"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.993863"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:54.993863"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.995315"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.995315"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.997048"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:54.997048"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:54.998184"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:54.998184"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:04:55.000146"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.002140"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:55.002140"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.003228"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:55.003228"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:55.004754"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.006954"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:55.006954"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.008006"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:55.008006"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:55.009412"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.011372"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:04:55.011372"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-05-08 12:04:55.012486"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:04:55.019167"], ["uid", 0], ["updated_at", "2015-05-08 12:04:55.019167"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.024984"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000295"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:55.024984"]]  (1.5ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.0ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.031855"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000295"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:55.031855"]]  (1.3ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:55.037120"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173095], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:55.037120"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.4ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.064387"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.064387"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.068599"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.068599"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.072089"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.072089"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:04:59.076647"], ["uid", 0], ["updated_at", "2015-05-08 12:04:59.076647"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.082732"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:04:59.082732"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-05-08 12:04:59.084273"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.086861"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.086861"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.090178"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.090178"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.092382"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.092382"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.093983"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.093983"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.096039"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.096039"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.097648"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.097648"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.099308"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.099308"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.100764"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.100764"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.102541"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.102541"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.103629"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.103629"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:04:59.105293"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.107272"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.107272"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.108318"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.108318"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:59.109719"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.111559"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:04:59.111559"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.112575"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.112575"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:04:59.114027"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.115889"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000299"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.115889"]]  (1.4ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.122646"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000299"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.122646"]]  (1.2ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.2ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:04:59.127909"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173099], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:04:59.127909"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:05:03.238400"], ["uid", 0], ["updated_at", "2015-05-08 12:05:03.238400"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.249222"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.249222"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.250596"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.250596"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:03.253842"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.256345"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.256345"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.257771"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.257771"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:05:03.259415"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.261754"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.261754"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.262952"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.262952"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-05-08 12:05:03.264324"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.266497"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.266497"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.269470"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.269470"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.271655"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.271655"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.273162"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.273162"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.275175"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.275175"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.276585"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.276585"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.278249"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:03.278249"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.279741"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.279741"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.281519"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:05:03.281519"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-05-08 12:05:03.282653"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.291219"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173103], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.291219"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.292966"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000303"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.292966"]]  (1.4ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.298411"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000303"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.298411"]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] Account Load (0.3ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.1ms) commit transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.311782"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.311782"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.315506"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.315506"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:03.318480"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:03.318480"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:05:07.280606"], ["uid", 0], ["updated_at", "2015-05-08 12:05:07.280606"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.292176"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173107], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.292176"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.294481"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000307"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.294481"]]  (1.5ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.304090"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000307"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.304090"]]  (1.4ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.4ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.313487"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:05:07.313487"]]  (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"."uid" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-05-08 12:05:07.315270"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.318244"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.318244"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.319458"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.319458"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:07.322279"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.324331"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.324331"]]  (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"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.325533"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.325533"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:07.326950"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.328907"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.328907"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.330078"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.330078"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:07.331504"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.333689"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.333689"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.336384"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.336384"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.338544"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.338544"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.340283"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.340283"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.342083"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.342083"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.343687"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.343687"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.345399"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:07.345399"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.347045"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.347045"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.356260"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.356260"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.359803"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.359803"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:07.363113"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:07.363113"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.698597"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.698597"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.703303"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.703303"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.707222"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.707222"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.731301"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-05-08 12:05:27.731301"]]  (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"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-05-08 12:05:27.733551"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.736266"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000327"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.736266"]]  (1.9ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1431259527"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-05-08 12:05:27.740389"]]  (1.5ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.746123"], ["oauth_access_token", "token"], ["oauth_expires_at", "1431000327"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.746123"]]  (1.5ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1431259527"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-05-08 12:05:27.749223"]]  (1.3ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.0ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.754065"], ["oauth_access_token", "token"], ["oauth_expires_at", 1431173127], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.754065"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.756227"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.756227"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.759116"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.759116"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.761243"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.761243"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.762707"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.762707"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.764431"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.764431"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.766259"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.766259"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.767690"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.767690"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.769028"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.769028"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.770931"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.770931"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.772026"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.772026"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:27.773514"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.775414"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.775414"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.776382"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.776382"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:27.777799"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.779869"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-05-08 12:05:27.779869"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-05-08 12:05:27.780915"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-05-08 12:05:27.780915"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-05-08 12:05:27.782351"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-05-08 12:05:27.787143"], ["uid", 0], ["updated_at", "2015-05-08 12:05:27.787143"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.9ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.923829"], ["updated_at", "2015-05-08 12:05:30.923829"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 23ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.928892"], ["updated_at", "2015-05-08 12:05:30.928892"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.932982"], ["updated_at", "2015-05-08 12:05:30.932982"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1431000330"], ["created_at", "2015-05-08 12:05:30.947611"], ["updated_at", "2015-05-08 12:05:30.947611"]]  (1.9ms) commit transaction  (0.0ms) begin transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) 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", "1431259530"], ["updated_at", "2015-05-08 12:05:30.952720"], ["id", 1]]  (1.2ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.0ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1431000330"], ["created_at", "2015-05-08 12:05:30.960087"], ["updated_at", "2015-05-08 12:05:30.960087"]]  (1.4ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) 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", "1431259530"], ["updated_at", "2015-05-08 12:05:30.963354"], ["id", 2]]  (1.3ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.4ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["uid", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1431173130"], ["created_at", "2015-05-08 12:05:30.969408"], ["updated_at", "2015-05-08 12:05:30.969408"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("uid", "created_at", "updated_at") VALUES (?, ?, ?) [["uid", 0], ["created_at", "2015-05-08 12:05:30.974276"], ["updated_at", "2015-05-08 12:05:30.974276"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:30.981437"], ["updated_at", "2015-05-08 12:05:30.981437"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.984511"], ["updated_at", "2015-05-08 12:05:30.984511"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:30.987161"], ["updated_at", "2015-05-08 12:05:30.987161"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.988875"], ["updated_at", "2015-05-08 12:05:30.988875"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:30.990726"], ["updated_at", "2015-05-08 12:05:30.990726"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.992335"], ["updated_at", "2015-05-08 12:05:30.992335"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:30.994064"], ["updated_at", "2015-05-08 12:05:30.994064"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("uid", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["uid", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-05-08 12:05:30.995979"], ["updated_at", "2015-05-08 12:05:30.995979"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:30.998006"], ["updated_at", "2015-05-08 12:05:30.998006"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-05-08 12:05:30.999229"], ["updated_at", "2015-05-08 12:05:30.999229"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) 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-05-08 12:05:31.000907"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:31.002760"], ["updated_at", "2015-05-08 12:05:31.002760"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-05-08 12:05:31.003946"], ["updated_at", "2015-05-08 12:05:31.003946"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) 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-05-08 12:05:31.005704"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 456], ["created_at", "2015-05-08 12:05:31.007609"], ["updated_at", "2015-05-08 12:05:31.007609"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "uid", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["uid", 123], ["created_at", "2015-05-08 12:05:31.008883"], ["updated_at", "2015-05-08 12:05:31.008883"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = ? AND "accounts"."provider" = ? LIMIT 1 [["uid", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) 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-05-08 12:05:31.010651"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1 SQL (0.1ms) 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-05-08 12:05:31.015296"], ["updated_at", "2015-05-08 12:05:31.015296"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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-05-08 12:05:31.016652"], ["id", 3]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.0ms) 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" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1 Completed 500 Internal Server Error in 1ms  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts" SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.2ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 14:57:16.457119"], ["synced_id", 0], ["updated_at", "2015-07-31 14:57:16.457119"]]  (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.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) 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" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.474505"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438441036], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.474505"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.476830"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438268236"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.476830"]]  (1.4ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438527436"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 14:57:16.481164"]]  (1.1ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.486721"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438268236"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.486721"]]  (1.8ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438527436"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 14:57:16.490690"]]  (4.8ms) commit transaction  (0.1ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.1ms) 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" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.500868"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.500868"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.502180"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.502180"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:57:16.505124"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.508494"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.508494"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.509807"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.509807"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:57:16.511378"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.513417"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.513417"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.514500"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.514500"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:57:16.515975"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.517975"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.517975"]]  (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" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.521135"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.521135"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.523003"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.523003"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.524648"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.524648"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.526424"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.526424"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.527917"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.527917"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.529547"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:57:16.529547"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.530952"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.530952"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.532631"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 14:57:16.532631"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-07-31 14:57:16.533667"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) 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 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.554105"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.554105"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.557755"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.557755"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:57:16.561136"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:57:16.561136"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.3ms) 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.2ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 14:57:19.379416"], ["updated_at", "2015-07-31 14:57:19.379416"]]  (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.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.394112"], ["updated_at", "2015-07-31 14:57:19.394112"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 14:57:19.396107"], ["updated_at", "2015-07-31 14:57:19.396107"]]  (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-07-31 14:57:19.401549"], ["id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.405240"], ["updated_at", "2015-07-31 14:57:19.405240"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 14:57:19.406804"], ["updated_at", "2015-07-31 14:57:19.406804"]]  (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.2ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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-07-31 14:57:19.409054"], ["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.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.413433"], ["updated_at", "2015-07-31 14:57:19.413433"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 14:57:19.415011"], ["updated_at", "2015-07-31 14:57:19.415011"]]  (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.0ms) 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-07-31 14:57:19.417052"], ["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.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.419472"], ["updated_at", "2015-07-31 14:57:19.419472"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-07-31 14:57:19.423028"], ["updated_at", "2015-07-31 14:57:19.423028"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.425727"], ["updated_at", "2015-07-31 14:57:19.425727"]]  (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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 14:57:19.430571"], ["updated_at", "2015-07-31 14:57:19.430571"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.433390"], ["updated_at", "2015-07-31 14:57:19.433390"]]  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 14:57:19.435376"], ["updated_at", "2015-07-31 14:57:19.435376"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:57:19.437297"], ["updated_at", "2015-07-31 14:57:19.437297"]]  (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.1ms) 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-07-31 14:57:19.439086"], ["updated_at", "2015-07-31 14:57:19.439086"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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", "1438441039"], ["created_at", "2015-07-31 14:57:19.441349"], ["updated_at", "2015-07-31 14:57:19.441349"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.4ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438268239"], ["created_at", "2015-07-31 14:57:19.443874"], ["updated_at", "2015-07-31 14:57:19.443874"]]  (1.4ms) commit transaction  (0.2ms) 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.1ms) 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", "1438527439"], ["updated_at", "2015-07-31 14:57:19.452142"], ["id", 1]]  (1.3ms) commit transaction Account Load (0.2ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.4ms) 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.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", "1438268239"], ["created_at", "2015-07-31 14:57:19.465509"], ["updated_at", "2015-07-31 14:57:19.465509"]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438527439"], ["updated_at", "2015-07-31 14:57:19.469008"], ["id", 2]]  (1.0ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.0ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) 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-07-31 14:57:19.474743"], ["updated_at", "2015-07-31 14:57:19.474743"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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-07-31 14:57:19.476482"], ["id", 3]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 14:57:19.505177"], ["updated_at", "2015-07-31 14:57:19.505177"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) 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.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-07-31 14:57:19.509765"], ["updated_at", "2015-07-31 14:57:19.509765"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 14:57:19.514717"], ["updated_at", "2015-07-31 14:57:19.514717"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.118646"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.118646"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.122704"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.122704"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.125728"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.125728"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.147660"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.147660"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.150572"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.150572"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.152603"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.152603"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.153999"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.153999"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.155493"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.155493"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.156893"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.156893"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.158286"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.158286"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.160351"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.160351"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.161861"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.161861"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.162798"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.162798"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:58:22.164743"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.166609"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.166609"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.167675"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.167675"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-07-31 14:58:22.168997"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.170819"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:58:22.170819"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.171780"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.171780"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-07-31 14:58:22.173009"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 14:58:22.176636"], ["synced_id", 0], ["updated_at", "2015-07-31 14:58:22.176636"]]  (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.1ms) rollback transaction  (0.0ms) begin transaction  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.182714"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 14:58:22.182714"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-07-31 14:58:22.183773"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.188512"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438268302"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.188512"]]  (1.0ms) 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" != 1) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438527502"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 14:58:22.191495"]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.196228"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438268302"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.196228"]]  (0.8ms) commit transaction  (0.0ms) 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.1ms) 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", "1438527502"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 14:58:22.198751"]]  (1.2ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.7ms) commit transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:58:22.202928"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438441102], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:58:22.202928"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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", "1438268304"], ["created_at", "2015-07-31 14:58:24.782941"], ["updated_at", "2015-07-31 14:58:24.782941"]]  (1.2ms) 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" != 1) LIMIT 1 SQL (0.1ms) 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", "1438527504"], ["updated_at", "2015-07-31 14:58:24.791559"], ["id", 1]]  (1.1ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438268304"], ["created_at", "2015-07-31 14:58:24.800921"], ["updated_at", "2015-07-31 14:58:24.800921"]]  (0.9ms) commit transaction  (0.0ms) 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.1ms) 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", "1438527504"], ["updated_at", "2015-07-31 14:58:24.803897"], ["id", 2]]  (0.9ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.7ms) commit transaction  (0.0ms) 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.1ms) 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", "1438441104"], ["created_at", "2015-07-31 14:58:24.808149"], ["updated_at", "2015-07-31 14:58:24.808149"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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-07-31 14:58:24.810293"], ["updated_at", "2015-07-31 14:58:24.810293"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) 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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 14:58:24.813365"], ["updated_at", "2015-07-31 14:58:24.813365"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:58:24.815724"], ["updated_at", "2015-07-31 14:58:24.815724"]]  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 14:58:24.817560"], ["updated_at", "2015-07-31 14:58:24.817560"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:58:24.819602"], ["updated_at", "2015-07-31 14:58:24.819602"]]  (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.1ms) 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-07-31 14:58:24.821235"], ["updated_at", "2015-07-31 14:58:24.821235"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:58:24.823381"], ["updated_at", "2015-07-31 14:58:24.823381"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 14:58:24.824948"], ["updated_at", "2015-07-31 14:58:24.824948"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:58:24.826787"], ["updated_at", "2015-07-31 14:58:24.826787"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 14:58:24.827919"], ["updated_at", "2015-07-31 14:58:24.827919"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) 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-07-31 14:58:24.829602"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:58:24.831596"], ["updated_at", "2015-07-31 14:58:24.831596"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 14:58:24.832806"], ["updated_at", "2015-07-31 14:58:24.832806"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) 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-07-31 14:58:24.834422"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 14:58:24.836476"], ["updated_at", "2015-07-31 14:58:24.836476"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 14:58:24.837675"], ["updated_at", "2015-07-31 14:58:24.837675"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) 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-07-31 14:58:24.839369"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 14:58:24.843016"], ["updated_at", "2015-07-31 14:58:24.843016"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) 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-07-31 14:58:24.856038"], ["updated_at", "2015-07-31 14:58:24.856038"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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-07-31 14:58:24.857277"], ["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 14:58:24.879724"], ["updated_at", "2015-07-31 14:58:24.879724"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.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-07-31 14:58:24.884287"], ["updated_at", "2015-07-31 14:58:24.884287"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 14:58:24.889063"], ["updated_at", "2015-07-31 14:58:24.889063"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) 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: 2.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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: 2.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.304932"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438441164], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.304932"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.307429"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438268364"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.307429"]]  (1.4ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438527564"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 14:59:24.314307"]]  (2.5ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (0.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.321516"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438268364"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.321516"]]  (0.6ms) commit transaction  (0.0ms) begin transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438527564"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 14:59:24.323788"]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (0.7ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.328342"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 14:59:24.328342"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-07-31 14:59:24.329311"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 14:59:24.332585"], ["synced_id", 0], ["updated_at", "2015-07-31 14:59:24.332585"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.341566"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.341566"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.342576"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.342576"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:59:24.344740"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.372766"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.372766"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.373797"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.373797"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:59:24.375057"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.376668"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.376668"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.377499"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.377499"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 14:59:24.378676"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.380516"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.380516"]]  (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" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.383237"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.383237"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.385213"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.385213"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.386453"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.386453"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.388204"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.388204"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.389485"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.389485"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.390811"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 14:59:24.390811"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.392080"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.392080"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.395867"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.395867"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.398848"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.398848"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 14:59:24.401886"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 14:59:24.401886"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.3ms) 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.0ms) 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.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:53.991512"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:53.991512"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:53.996586"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:53.996586"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:53.999786"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:53.999786"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 15:24:54.025081"], ["synced_id", 0], ["updated_at", "2015-07-31 15:24:54.025081"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.031688"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 15:24:54.031688"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-07-31 15:24:54.033202"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.035639"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.035639"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.038668"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.038668"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.066897"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.066897"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.068255"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.068255"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.070382"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.070382"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.071647"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.071647"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.073079"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.073079"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.074251"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.074251"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.075808"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.075808"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.076687"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:24:54.076687"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.077877"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.077877"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.079763"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.079763"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.080656"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:24:54.080656"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.081848"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.081848"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.083489"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:24:54.083489"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.084369"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:24:54.084369"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.085720"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:24:54.085720"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.088629"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438269894"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:24:54.088629"]]  (1.2ms) 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" != 5) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 5 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438529094"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:24:54.091830"]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.096433"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438269894"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:24:54.096433"]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 6 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438529094"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:24:54.099206"]]  (1.0ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (1.0ms) commit transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:24:54.103844"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438442694], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:24:54.103844"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 15:27:42.163722"], ["synced_id", 0], ["updated_at", "2015-07-31 15:27:42.163722"]]  (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.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.175267"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 15:27:42.175267"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-07-31 15:27:42.177039"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.185402"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.185402"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.186499"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:27:42.186499"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.190065"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.190065"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.192609"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.192609"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.193641"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:27:42.193641"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.195011"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.195011"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.196796"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.196796"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.197737"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:27:42.197737"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.198938"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.198938"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.200758"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.200758"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.203428"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.203428"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.205421"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.205421"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.206957"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.206957"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.208678"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.208678"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.210118"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.210118"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.211680"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:27:42.211680"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.212980"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.212980"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.214785"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438442862], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:27:42.214785"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.216463"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270062"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:27:42.216463"]]  (2.3ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438529262"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:27:42.221012"]]  (3.0ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.0ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.6ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.228643"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270062"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:27:42.228643"]]  (1.6ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438529262"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:27:42.233750"]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]] Account Load (0.0ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.9ms) commit transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.246264"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.246264"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.249230"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.249230"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:27:42.252473"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:27:42.252473"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:37.638909"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 15:30:37.638909"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-07-31 15:30:37.641506"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:37.651597"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438443037], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:30:37.651597"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:37.653609"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270237"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:30:37.653609"]]  (1.1ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438529437"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:30:37.657257"]]  (0.9ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:37.661819"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270237"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:30:37.661819"]]  (0.7ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438529437"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:30:37.664196"]]  (1.0ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 15:30:37.672056"], ["synced_id", 0], ["updated_at", "2015-07-31 15:30:37.672056"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:37.677585"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:37.677585"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:37.678709"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:30:37.678709"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:50.397278"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:50.397278"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:50.400332"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:50.400332"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:50.401697"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:30:50.401697"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:51.451860"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:51.451860"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:51.454102"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:51.454102"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:51.455215"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:30:51.455215"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:51.924047"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:51.924047"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:51.926501"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:51.926501"]]  (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" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:52.659864"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:52.659864"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:52.662036"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:52.662036"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:53.403369"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:53.403369"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:53.405282"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:53.405282"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:53.971518"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:53.971518"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:30:53.973316"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:30:53.973316"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:54.444210"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:54.444210"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Rendered text template (0.1ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:55.067555"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:55.067555"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 605ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:55.460154"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:55.460154"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 391ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:30:56.116624"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["updated_at", "2015-07-31 15:30:56.116624"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 655ms (ActiveRecord: 0.5ms)  (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.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:32:38.778798"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438443158], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:32:38.778798"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:32:38.781656"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270358"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:32:38.781656"]]  (1.4ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438529558"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:32:38.788509"]]  (1.3ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (3.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:32:38.797429"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270358"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:32:38.797429"]]  (1.0ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438529558"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:32:38.800318"]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 15:32:38.809943"], ["synced_id", 0], ["updated_at", "2015-07-31 15:32:38.809943"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:32:38.815109"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 15:32:38.815109"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-07-31 15:32:38.816418"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:32:38.818499"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:32:38.818499"]]  (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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:32:38.819604"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:32:38.819604"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 15:34:23.195563"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.2ms) 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.2ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 15:34:30.287520"], ["synced_id", 0], ["updated_at", "2015-07-31 15:34:30.287520"]]  (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.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.298097"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 15:34:30.298097"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-07-31 15:34:30.299555"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.301959"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438443270], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.301959"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.304849"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270470"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.304849"]]  (1.6ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438529670"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:34:30.312060"]]  (1.1ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.316759"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438270470"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.316759"]]  (0.7ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438529670"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 15:34:30.320796"]]  (1.3ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.6ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.330517"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.330517"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.0ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.331778"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.331778"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 15:34:30.334346"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.336474"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.336474"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (1.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.337535"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.337535"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 15:34:30.342310"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.344484"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.344484"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.345596"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.345596"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 15:34:30.346873"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.349017"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.349017"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.351815"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.351815"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.353706"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.353706"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.354980"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.354980"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.356890"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.356890"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.358418"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.358418"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.360183"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 15:34:30.360183"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.361579"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.361579"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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: 2.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.381206"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.381206"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.384485"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.384485"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 15:34:30.387615"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 15:34:30.387615"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.3ms) 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.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) 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.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-07-31 15:34:33.025762"], ["updated_at", "2015-07-31 15:34:33.025762"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 1.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 15:34:33.033018"], ["updated_at", "2015-07-31 15:34:33.033018"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 15:34:33.037238"], ["updated_at", "2015-07-31 15:34:33.037238"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) 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.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) 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-07-31 15:34:33.060276"], ["updated_at", "2015-07-31 15:34:33.060276"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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-07-31 15:34:33.062252"], ["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.066894"], ["updated_at", "2015-07-31 15:34:33.066894"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 15:34:33.068469"], ["updated_at", "2015-07-31 15:34:33.068469"]]  (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 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-07-31 15:34:33.070304"], ["id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.072497"], ["updated_at", "2015-07-31 15:34:33.072497"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 15:34:33.073852"], ["updated_at", "2015-07-31 15:34:33.073852"]]  (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.0ms) 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-07-31 15:34:33.075540"], ["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.1ms) rollback transaction  (0.0ms) 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 (1.0ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.077643"], ["updated_at", "2015-07-31 15:34:33.077643"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 15:34:33.086939"], ["updated_at", "2015-07-31 15:34:33.086939"]]  (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-07-31 15:34:33.088914"], ["id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.091202"], ["updated_at", "2015-07-31 15:34:33.091202"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 15:34:33.094556"], ["updated_at", "2015-07-31 15:34:33.094556"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.097119"], ["updated_at", "2015-07-31 15:34:33.097119"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 15:34:33.098850"], ["updated_at", "2015-07-31 15:34:33.098850"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.100925"], ["updated_at", "2015-07-31 15:34:33.100925"]]  (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.1ms) 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-07-31 15:34:33.102591"], ["updated_at", "2015-07-31 15:34:33.102591"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 15:34:33.104501"], ["updated_at", "2015-07-31 15:34:33.104501"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 15:34:33.106186"], ["updated_at", "2015-07-31 15:34:33.106186"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 15:34:33.112710"], ["updated_at", "2015-07-31 15:34:33.112710"]]  (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.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "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", "1438443273"], ["created_at", "2015-07-31 15:34:33.123166"], ["updated_at", "2015-07-31 15:34:33.123166"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.1ms) 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", "1438270473"], ["created_at", "2015-07-31 15:34:33.126306"], ["updated_at", "2015-07-31 15:34:33.126306"]]  (1.6ms) commit transaction  (0.1ms) 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.1ms) 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", "1438529673"], ["updated_at", "2015-07-31 15:34:33.130780"], ["id", 1]]  (1.1ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.8ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438270473"], ["created_at", "2015-07-31 15:34:33.135882"], ["updated_at", "2015-07-31 15:34:33.135882"]]  (0.9ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438529673"], ["updated_at", "2015-07-31 15:34:33.138976"], ["id", 2]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.8ms) commit transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-07-31 19:21:40.609373"], ["updated_at", "2015-07-31 19:21:40.609373"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 15ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:21:40.614089"], ["updated_at", "2015-07-31 19:21:40.614089"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 19:21:40.618881"], ["updated_at", "2015-07-31 19:21:40.618881"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438284100"], ["created_at", "2015-07-31 19:21:40.631933"], ["updated_at", "2015-07-31 19:21:40.631933"]]  (1.3ms) commit transaction  (0.0ms) begin transaction  (0.2ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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", "1438543300"], ["updated_at", "2015-07-31 19:21:40.636455"], ["id", 3]]  (1.1ms) commit transaction  (0.1ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (1.1ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438284100"], ["created_at", "2015-07-31 19:21:40.642536"], ["updated_at", "2015-07-31 19:21:40.642536"]]  (2.0ms) commit transaction  (0.1ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) 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", "1438543300"], ["updated_at", "2015-07-31 19:21:40.646490"], ["id", 4]]  (1.1ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (1.2ms) commit transaction  (0.0ms) 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.1ms) 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", "1438456900"], ["created_at", "2015-07-31 19:21:40.651638"], ["updated_at", "2015-07-31 19:21:40.651638"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 19:21:40.655953"], ["updated_at", "2015-07-31 19:21:40.655953"]]  (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.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) 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-07-31 19:21:40.661040"], ["updated_at", "2015-07-31 19:21:40.661040"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) 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-07-31 19:21:40.662190"], ["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.664460"], ["updated_at", "2015-07-31 19:21:40.664460"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:21:40.665591"], ["updated_at", "2015-07-31 19:21:40.665591"]]  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) 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-07-31 19:21:40.667569"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.669493"], ["updated_at", "2015-07-31 19:21:40.669493"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:21:40.670566"], ["updated_at", "2015-07-31 19:21:40.670566"]]  (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" != 6) 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-07-31 19:21:40.671981"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.673950"], ["updated_at", "2015-07-31 19:21:40.673950"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:21:40.674969"], ["updated_at", "2015-07-31 19:21:40.674969"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.0ms) 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-07-31 19:21:40.676467"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.678505"], ["updated_at", "2015-07-31 19:21:40.678505"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:21:40.681423"], ["updated_at", "2015-07-31 19:21:40.681423"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.683492"], ["updated_at", "2015-07-31 19:21:40.683492"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:21:40.684839"], ["updated_at", "2015-07-31 19:21:40.684839"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.686413"], ["updated_at", "2015-07-31 19:21:40.686413"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:21:40.687741"], ["updated_at", "2015-07-31 19:21:40.687741"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:21:40.689289"], ["updated_at", "2015-07-31 19:21:40.689289"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:21:40.690643"], ["updated_at", "2015-07-31 19:21:40.690643"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("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-07-31 19:24:54.520230"], ["updated_at", "2015-07-31 19:24:54.520230"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:24:54.525044"], ["updated_at", "2015-07-31 19:24:54.525044"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.9ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:24:54.530230"], ["updated_at", "2015-07-31 19:24:54.530230"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.2ms) 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.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("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-07-31 19:27:24.047924"], ["updated_at", "2015-07-31 19:27:24.047924"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 1.3ms)  (0.1ms) rollback transaction  (0.2ms) 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.9ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-07-31 19:27:31.367967"], ["updated_at", "2015-07-31 19:27:31.367967"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 1.8ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.3ms) begin transaction  (0.9ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 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.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-07-31 19:29:46.041491"], ["updated_at", "2015-07-31 19:29:46.041491"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.2ms) 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.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("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-07-31 19:30:06.919858"], ["updated_at", "2015-07-31 19:30:06.919858"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 1.2ms)  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("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-07-31 19:30:09.864219"], ["updated_at", "2015-07-31 19:30:09.864219"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) 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.9ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2015-07-31 19:30:09.868787"], ["updated_at", "2015-07-31 19:30:09.868787"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:30:09.873244"], ["updated_at", "2015-07-31 19:30:09.873244"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.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-07-31 19:30:13.200468"], ["updated_at", "2015-07-31 19:30:13.200468"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:30:13.204798"], ["updated_at", "2015-07-31 19:30:13.204798"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:30:13.209291"], ["updated_at", "2015-07-31 19:30:13.209291"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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-07-31 19:30:13.223182"], ["updated_at", "2015-07-31 19:30:13.223182"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:30:13.225293"], ["updated_at", "2015-07-31 19:30:13.225293"]]  (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" != 6) 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-07-31 19:30:13.227512"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:30:13.230347"], ["updated_at", "2015-07-31 19:30:13.230347"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:30:13.231436"], ["updated_at", "2015-07-31 19:30:13.231436"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.0ms) 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-07-31 19:30:13.232726"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:30:13.234763"], ["updated_at", "2015-07-31 19:30:13.234763"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:30:13.235918"], ["updated_at", "2015-07-31 19:30:13.235918"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.0ms) 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-07-31 19:30:13.237332"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:30:13.239742"], ["updated_at", "2015-07-31 19:30:13.239742"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:30:13.242480"], ["updated_at", "2015-07-31 19:30:13.242480"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:30:13.244505"], ["updated_at", "2015-07-31 19:30:13.244505"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:30:13.245923"], ["updated_at", "2015-07-31 19:30:13.245923"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:30:13.247684"], ["updated_at", "2015-07-31 19:30:13.247684"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:30:13.248985"], ["updated_at", "2015-07-31 19:30:13.248985"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:30:13.250511"], ["updated_at", "2015-07-31 19:30:13.250511"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:30:13.251863"], ["updated_at", "2015-07-31 19:30:13.251863"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 19:30:13.256286"], ["updated_at", "2015-07-31 19:30:13.256286"]]  (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.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) 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-07-31 19:30:13.261705"], ["updated_at", "2015-07-31 19:30:13.261705"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) 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", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-07-31 19:30:13.262870"], ["id", 5]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438284613"], ["created_at", "2015-07-31 19:30:13.267911"], ["updated_at", "2015-07-31 19:30:13.267911"]]  (1.1ms) 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" != 5) LIMIT 1 SQL (0.1ms) 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", "1438543813"], ["updated_at", "2015-07-31 19:30:13.271527"], ["id", 5]]  (0.9ms) commit transaction  (0.0ms) rollback transaction Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 5]]  (0.7ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438284613"], ["created_at", "2015-07-31 19:30:13.276285"], ["updated_at", "2015-07-31 19:30:13.276285"]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 SQL (0.1ms) 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", "1438543813"], ["updated_at", "2015-07-31 19:30:13.278813"], ["id", 6]]  (1.2ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 6]]  (0.8ms) commit transaction  (0.0ms) 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.1ms) 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", "1438457413"], ["created_at", "2015-07-31 19:30:13.284910"], ["updated_at", "2015-07-31 19:30:13.284910"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as HTML Redirected to http://test.host/auth/bookingsync/?account_id= Filter chain halted as :authenticate_account! rendered or redirected Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "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", "1438457583"], ["created_at", "2015-07-31 19:33:03.883508"], ["updated_at", "2015-07-31 19:33:03.883508"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438284783"], ["created_at", "2015-07-31 19:33:03.886330"], ["updated_at", "2015-07-31 19:33:03.886330"]]  (1.3ms) commit transaction  (0.1ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 7) LIMIT 1 SQL (0.1ms) 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", "1438543983"], ["updated_at", "2015-07-31 19:33:03.894002"], ["id", 7]]  (1.6ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 7]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438284783"], ["created_at", "2015-07-31 19:33:03.901527"], ["updated_at", "2015-07-31 19:33:03.901527"]]  (0.7ms) commit transaction  (0.0ms) begin transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1 SQL (0.1ms) 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", "1438543983"], ["updated_at", "2015-07-31 19:33:03.904449"], ["id", 8]]  (1.0ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 8]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 8]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.909487"], ["updated_at", "2015-07-31 19:33:03.909487"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 9) LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.910563"], ["id", 9]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 9]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.912540"], ["updated_at", "2015-07-31 19:33:03.912540"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:33:03.913546"], ["updated_at", "2015-07-31 19:33:03.913546"]]  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) 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-07-31 19:33:03.914930"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.917023"], ["updated_at", "2015-07-31 19:33:03.917023"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:33:03.918024"], ["updated_at", "2015-07-31 19:33:03.918024"]]  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) 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-07-31 19:33:03.919458"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.921247"], ["updated_at", "2015-07-31 19:33:03.921247"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:33:03.922232"], ["updated_at", "2015-07-31 19:33:03.922232"]]  (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" != 10) LIMIT 1 SQL (0.0ms) 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-07-31 19:33:03.923503"], ["id", 10]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 10]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.925463"], ["updated_at", "2015-07-31 19:33:03.925463"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.928014"], ["updated_at", "2015-07-31 19:33:03.928014"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.929865"], ["updated_at", "2015-07-31 19:33:03.929865"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.931159"], ["updated_at", "2015-07-31 19:33:03.931159"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.932883"], ["updated_at", "2015-07-31 19:33:03.932883"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.934243"], ["updated_at", "2015-07-31 19:33:03.934243"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:03.935922"], ["updated_at", "2015-07-31 19:33:03.935922"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.937185"], ["updated_at", "2015-07-31 19:33:03.937185"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 19:33:03.944233"], ["updated_at", "2015-07-31 19:33:03.944233"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) 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: 2.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 19:33:03.969739"], ["updated_at", "2015-07-31 19:33:03.969739"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:33:03.973797"], ["updated_at", "2015-07-31 19:33:03.973797"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:03.976688"], ["updated_at", "2015-07-31 19:33:03.976688"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) 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.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.918807"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 19:33:10.918807"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "2015-07-31 19:33:10.920613"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.924170"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.924170"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.925358"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.925358"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 2 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 19:33:10.928241"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.930486"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.930486"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.931632"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.931632"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-07-31 19:33:10.933004"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.934946"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.934946"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.936202"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.936202"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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", "2015-07-31 19:33:10.937500"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.939784"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.939784"]]  (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" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.942442"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.942442"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.944724"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.944724"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.946169"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.946169"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.948015"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.948015"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.949462"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.949462"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.951153"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:33:10.951153"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.952562"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.952562"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.961471"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438457590], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.961471"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.963475"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438284790"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.963475"]]  (1.3ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438543990"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 19:33:10.966995"]]  (1.1ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (0.7ms) 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.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.971828"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438284790"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.971828"]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438543990"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 19:33:10.974873"]]  (1.0ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.7ms) commit transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 19:33:10.981993"], ["synced_id", 0], ["updated_at", "2015-07-31 19:33:10.981993"]]  (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.2ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.989814"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.989814"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.993866"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.993866"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:33:10.997765"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:33:10.997765"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 0ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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 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.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-07-31 19:33:14.125522"], ["updated_at", "2015-07-31 19:33:14.125522"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 19:33:14.131522"], ["updated_at", "2015-07-31 19:33:14.131522"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 19:33:14.136611"], ["updated_at", "2015-07-31 19:33:14.136611"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Rendered text template (0.0ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.0ms) 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-07-31 19:33:14.163957"], ["updated_at", "2015-07-31 19:33:14.163957"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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-07-31 19:33:14.165948"], ["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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", "1438457594"], ["created_at", "2015-07-31 19:33:14.170486"], ["updated_at", "2015-07-31 19:33:14.170486"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438284794"], ["created_at", "2015-07-31 19:33:14.173189"], ["updated_at", "2015-07-31 19:33:14.173189"]]  (1.8ms) commit transaction  (0.1ms) 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.1ms) 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", "1438543994"], ["updated_at", "2015-07-31 19:33:14.177909"], ["id", 1]]  (1.3ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.1ms) 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.1ms) 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", "1438284794"], ["created_at", "2015-07-31 19:33:14.183958"], ["updated_at", "2015-07-31 19:33:14.183958"]]  (1.6ms) 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.1ms) 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", "1438543994"], ["updated_at", "2015-07-31 19:33:14.187979"], ["id", 2]]  (1.2ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.5ms) commit transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.194153"], ["updated_at", "2015-07-31 19:33:14.194153"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:33:14.195626"], ["updated_at", "2015-07-31 19:33:14.195626"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) 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-07-31 19:33:14.197394"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.199417"], ["updated_at", "2015-07-31 19:33:14.199417"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:33:14.200593"], ["updated_at", "2015-07-31 19:33:14.200593"]]  (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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) 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-07-31 19:33:14.202227"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.204173"], ["updated_at", "2015-07-31 19:33:14.204173"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:33:14.205329"], ["updated_at", "2015-07-31 19:33:14.205329"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) 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-07-31 19:33:14.206910"], ["id", 4]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.208833"], ["updated_at", "2015-07-31 19:33:14.208833"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = ? AND "accounts"."provider" = ? LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:14.211780"], ["updated_at", "2015-07-31 19:33:14.211780"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.8ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.213685"], ["updated_at", "2015-07-31 19:33:14.213685"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:14.215853"], ["updated_at", "2015-07-31 19:33:14.215853"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.217819"], ["updated_at", "2015-07-31 19:33:14.217819"]]  (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.1ms) 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-07-31 19:33:14.219423"], ["updated_at", "2015-07-31 19:33:14.219423"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:33:14.221227"], ["updated_at", "2015-07-31 19:33:14.221227"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:33:14.222846"], ["updated_at", "2015-07-31 19:33:14.222846"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 19:33:14.226876"], ["updated_at", "2015-07-31 19:33:14.226876"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.4ms) rollback transaction  (0.2ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.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-07-31 19:45:48.685514"], ["updated_at", "2015-07-31 19:45:48.685514"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 15ms (ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:45:48.689893"], ["updated_at", "2015-07-31 19:45:48.689893"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.693352"], ["updated_at", "2015-07-31 19:45:48.693352"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438285548"], ["created_at", "2015-07-31 19:45:48.701110"], ["updated_at", "2015-07-31 19:45:48.701110"]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) 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", "1438544748"], ["updated_at", "2015-07-31 19:45:48.705811"], ["id", 3]]  (1.5ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 3]]  (0.7ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438285548"], ["created_at", "2015-07-31 19:45:48.711169"], ["updated_at", "2015-07-31 19:45:48.711169"]]  (1.1ms) commit transaction  (0.0ms) begin transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) 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", "1438544748"], ["updated_at", "2015-07-31 19:45:48.713995"], ["id", 4]]  (2.1ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]] Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 4]]  (0.8ms) commit transaction  (0.0ms) 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.1ms) 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", "1438458348"], ["created_at", "2015-07-31 19:45:48.720715"], ["updated_at", "2015-07-31 19:45:48.720715"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 19:45:48.724559"], ["updated_at", "2015-07-31 19:45:48.724559"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.732930"], ["updated_at", "2015-07-31 19:45:48.732930"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) 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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.735794"], ["updated_at", "2015-07-31 19:45:48.735794"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.737754"], ["updated_at", "2015-07-31 19:45:48.737754"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.739105"], ["updated_at", "2015-07-31 19:45:48.739105"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.740910"], ["updated_at", "2015-07-31 19:45:48.740910"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.742333"], ["updated_at", "2015-07-31 19:45:48.742333"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.744046"], ["updated_at", "2015-07-31 19:45:48.744046"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.745344"], ["updated_at", "2015-07-31 19:45:48.745344"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.747040"], ["updated_at", "2015-07-31 19:45:48.747040"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:45:48.748090"], ["updated_at", "2015-07-31 19:45:48.748090"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) 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-07-31 19:45:48.749400"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.751378"], ["updated_at", "2015-07-31 19:45:48.751378"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:45:48.752471"], ["updated_at", "2015-07-31 19:45:48.752471"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) 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-07-31 19:45:48.753784"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:48.756048"], ["updated_at", "2015-07-31 19:45:48.756048"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:45:48.757036"], ["updated_at", "2015-07-31 19:45:48.757036"]]  (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" != 6) LIMIT 1 SQL (0.0ms) 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-07-31 19:45:48.758347"], ["id", 6]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 6]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.760503"], ["updated_at", "2015-07-31 19:45:48.760503"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 5) LIMIT 1 SQL (0.1ms) 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-07-31 19:45:48.761541"], ["id", 5]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 5]]  (0.1ms) rollback transaction  (0.0ms) 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.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.2ms) 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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by AuthenticatedController#index as JS Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 23ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by AuthenticatedController#index as HTML Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) 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.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.008198"], ["oauth_access_token", "token"], ["oauth_expires_at", 1438458356], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.008198"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.010376"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438285556"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.010376"]]  (1.4ms) commit transaction  (0.1ms) 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.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 1 [["oauth_access_token", "refreshed_token"], ["oauth_expires_at", "1438544756"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 19:45:56.014229"]]  (2.1ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.1ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.3ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.021407"], ["oauth_access_token", "token"], ["oauth_expires_at", "1438285556"], ["oauth_refresh_token", "refresh_token"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.021407"]]  (0.7ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438544756"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-07-31 19:45:56.024158"]]  (3.8ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (0.9ms) commit transaction  (0.0ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "accounts" ("created_at", "synced_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-07-31 19:45:56.034427"], ["synced_id", 0], ["updated_at", "2015-07-31 19:45:56.034427"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1  (0.2ms) rollback transaction  (0.0ms) 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.6ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.041136"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.041136"]]  (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" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.046464"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.046464"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.6ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.048838"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.048838"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.050831"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.050831"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.5ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.052903"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.052903"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.054949"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.054949"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.056638"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.056638"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.057874"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.057874"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.059870"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.059870"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.060786"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.060786"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 19:45:56.062074"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.064137"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.064137"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.065115"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.065115"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 19:45:56.066501"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.068495"], ["provider", "bookingsync"], ["synced_id", 456], ["updated_at", "2015-07-31 19:45:56.068495"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.069459"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.069459"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 SQL (0.0ms) UPDATE "accounts" SET "name" = ?, "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 4 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["updated_at", "2015-07-31 19:45:56.070745"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 4]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.072881"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-07-31 19:45:56.072881"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 3) LIMIT 1 SQL (0.1ms) UPDATE "accounts" SET "oauth_access_token" = ?, "oauth_expires_at" = ?, "oauth_refresh_token" = ?, "updated_at" = ? WHERE "accounts"."id" = 3 [["oauth_access_token", nil], ["oauth_expires_at", nil], ["oauth_refresh_token", nil], ["updated_at", "2015-07-31 19:45:56.073905"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.087483"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.087483"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.090821"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.090821"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "synced_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-07-31 19:45:56.094207"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["synced_id", 123], ["updated_at", "2015-07-31 19:45:56.094207"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "created_at", "updated_at") VALUES (?, ?, ?) [["synced_id", 0], ["created_at", "2015-07-31 19:45:59.267151"], ["updated_at", "2015-07-31 19:45:59.267151"]]  (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.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 SQL (0.2ms) 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-07-31 19:45:59.278204"], ["updated_at", "2015-07-31 19:45:59.278204"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 1) 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", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2015-07-31 19:45:59.280238"], ["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.286138"], ["updated_at", "2015-07-31 19:45:59.286138"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) 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.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:59.289477"], ["updated_at", "2015-07-31 19:45:59.289477"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.292238"], ["updated_at", "2015-07-31 19:45:59.292238"]]  (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.1ms) 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-07-31 19:45:59.294197"], ["updated_at", "2015-07-31 19:45:59.294197"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.296839"], ["updated_at", "2015-07-31 19:45:59.296839"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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-07-31 19:45:59.298576"], ["updated_at", "2015-07-31 19:45:59.298576"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.300770"], ["updated_at", "2015-07-31 19:45:59.300770"]]  (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.1ms) 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-07-31 19:45:59.302400"], ["updated_at", "2015-07-31 19:45:59.302400"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.304440"], ["updated_at", "2015-07-31 19:45:59.304440"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:45:59.305820"], ["updated_at", "2015-07-31 19:45:59.305820"]]  (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.0ms) 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-07-31 19:45:59.307789"], ["id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.309852"], ["updated_at", "2015-07-31 19:45:59.309852"]]  (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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:45:59.311200"], ["updated_at", "2015-07-31 19:45:59.311200"]]  (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.0ms) 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-07-31 19:45:59.313279"], ["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.1ms) rollback transaction  (0.0ms) 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.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2015-07-31 19:45:59.315611"], ["updated_at", "2015-07-31 19:45:59.315611"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2015-07-31 19:45:59.316943"], ["updated_at", "2015-07-31 19:45:59.316943"]]  (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.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 SQL (0.0ms) 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-07-31 19:45:59.318565"], ["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.1ms) rollback transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438285559"], ["created_at", "2015-07-31 19:45:59.321070"], ["updated_at", "2015-07-31 19:45:59.321070"]]  (1.4ms) commit transaction  (0.2ms) begin transaction Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 1) LIMIT 1 SQL (0.1ms) 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", "1438544759"], ["updated_at", "2015-07-31 19:45:59.328617"], ["id", 1]]  (1.2ms) commit transaction Account Load (0.1ms) SELECT "accounts".* FROM "accounts"  (0.0ms) begin transaction SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 1]]  (1.0ms) commit transaction  (0.0ms) begin transaction Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 SQL (0.1ms) 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", "1438285559"], ["created_at", "2015-07-31 19:45:59.333843"], ["updated_at", "2015-07-31 19:45:59.333843"]]  (1.3ms) commit transaction  (0.0ms) begin transaction  (0.0ms) 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.1ms) 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", "1438544759"], ["updated_at", "2015-07-31 19:45:59.337201"], ["id", 2]]  (0.8ms) commit transaction  (0.0ms) rollback transaction Account Load (0.1ms) 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.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = ? [["id", 2]]  (1.0ms) commit transaction  (0.0ms) 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.1ms) 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", "1438458359"], ["created_at", "2015-07-31 19:45:59.342240"], ["updated_at", "2015-07-31 19:45:59.342240"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#failure as HTML Rendered /home/fred/zadcopy/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.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-07-31 19:45:59.374762"], ["updated_at", "2015-07-31 19:45:59.374762"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) 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.1ms) 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-07-31 19:45:59.381511"], ["updated_at", "2015-07-31 19:45:59.381511"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) 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-07-31 19:45:59.387952"], ["updated_at", "2015-07-31 19:45:59.387952"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.5ms) rollback transaction  (0.0ms) 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 10ms (Views: 9.4ms | 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.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) 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.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) 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.0ms) rollback transaction