bookingsync-engine 0.3.0 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ae00ce19219761e0abbc27ace29a7f20bdb1447
4
- data.tar.gz: ef40132054bcf8364283ead050cb93a72554843f
3
+ metadata.gz: d93adbbbc222b81d24568db7658cb1eed95d072e
4
+ data.tar.gz: e473056b861f09e6b3e25be301472b1584792850
5
5
  SHA512:
6
- metadata.gz: 8979a3e4ec2f5aa70f3fec7286eabf1aff35bf50834694d1c04ab259d0f47db3b8d94c9bf46d99f903579b874350d71b8e4b13541c98c8a79ae0e01d601a1a5f
7
- data.tar.gz: 126b5e553d2cb8b49b7ae3b7ad0a50de05785dcac18f400e770a6b806f1d5a41a38ec64b42f968d6a259c4de7ba88af6af226d32295c07d4822250e146bd0529
6
+ metadata.gz: 67b4de4948fff649d4c5f0342915836f434d2d622c061234652ce6282f74f6789e2f11ecc2244c8a94c32c663f929563ba4b2d882c2f0805b374220b548d2e22
7
+ data.tar.gz: 0d209ea2ca8feff16d6d64ee807cbc7f55ce1e3a9c0c4dbbf911489fded2179c36356e7e1869e2150bc818491fe4b4a8a0cb58926ea245a3142d684a7f0c82ed
@@ -85,4 +85,5 @@ module BookingSync
85
85
  end
86
86
  end
87
87
 
88
+ require "bookingsync/engine/api_client"
88
89
  require "bookingsync/engine/model"
@@ -0,0 +1,19 @@
1
+ class BookingSync::Engine::APIClient < BookingSync::API::Client
2
+ def initialize(token, options = {})
3
+ super
4
+ @account = options[:account]
5
+ end
6
+
7
+ def call(method, path, data = nil, options = nil)
8
+ tries ||= 1
9
+ super
10
+ rescue BookingSync::API::Unauthorized => e
11
+ token_expired = e.headers["www-authenticate"].include?("The access token expired")
12
+ if token_expired && (tries -= 1) >= 0
13
+ @token = @account.refresh_token!.token
14
+ retry
15
+ else
16
+ raise
17
+ end
18
+ end
19
+ end
@@ -3,6 +3,7 @@ module BookingSync::Engine::Model
3
3
 
4
4
  included do
5
5
  validates :uid, uniqueness: true
6
+ scope :authorized, -> { where.not(oauth_access_token: nil) }
6
7
  end
7
8
 
8
9
  module ClassMethods
@@ -27,16 +28,19 @@ module BookingSync::Engine::Model
27
28
  oauth_access_token, token_options)
28
29
 
29
30
  if token.expired?
30
- token = token.refresh!
31
- update_token!(token)
31
+ refresh_token!(token)
32
+ else
33
+ token
32
34
  end
33
-
34
- token
35
35
  end
36
36
  end
37
37
 
38
+ def refresh_token!(current_token = token)
39
+ @token = current_token.refresh!.tap { |new_token| update_token!(new_token) }
40
+ end
41
+
38
42
  def api
39
- @api ||= BookingSync::API::Client.new(token.token)
43
+ @api ||= BookingSync::Engine::APIClient.new(token.token, account: self)
40
44
  end
41
45
 
42
46
  def update_token(token)
@@ -1,3 +1,3 @@
1
1
  module BookingSync
2
- ENGINE_VERSION = "0.3.0"
2
+ ENGINE_VERSION = "0.4.3"
3
3
  end
Binary file
@@ -0,0 +1,16 @@
1
+  (1.0ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime, "provider" varchar(255), "uid" integer, "name" varchar(255), "oauth_access_token" varchar(255), "oauth_refresh_token" varchar(255), "oauth_expires_at" varchar(255)) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.9ms) CREATE INDEX "index_accounts_on_uid" ON "accounts" ("uid")
4
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6
+  (0.1ms) SELECT version FROM "schema_migrations"
7
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
8
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
9
+  (1.0ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime, "provider" varchar(255), "uid" integer, "name" varchar(255), "oauth_access_token" varchar(255), "oauth_refresh_token" varchar(255), "oauth_expires_at" varchar(255)) 
10
+  (0.1ms) select sqlite_version(*)
11
+  (0.9ms) CREATE INDEX "index_accounts_on_uid" ON "accounts" ("uid")
12
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
13
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+  (0.1ms) SELECT version FROM "schema_migrations"
15
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
16
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
@@ -1,1367 +1,1110 @@
1
1
   (0.2ms) begin transaction
2
-  (0.1ms) rollback transaction
3
-  (0.1ms) begin transaction
4
-  (0.0ms) rollback transaction
5
-  (0.0ms) begin transaction
6
-  (0.0ms) rollback transaction
7
-  (0.0ms) begin transaction
8
-  (0.0ms) rollback transaction
9
-  (0.0ms) begin transaction
10
-  (0.0ms) rollback transaction
11
-  (0.0ms) begin transaction
12
-  (0.0ms) rollback transaction
13
-  (0.0ms) begin transaction
14
-  (0.0ms) rollback transaction
15
-  (0.0ms) begin transaction
2
+ Processing by AuthenticatedController#index as JS
3
+ Rendered text template (0.0ms)
4
+ Filter chain halted as :authenticate_account! rendered or redirected
5
+ Completed 401 Unauthorized in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)
16
6
   (0.0ms) rollback transaction
17
7
   (0.0ms) begin transaction
8
+ Processing by AuthenticatedController#index as JS
9
+ Filter chain halted as :authenticate_account! rendered or redirected
10
+ Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
18
11
   (0.0ms) rollback transaction
19
12
   (0.0ms) begin transaction
20
- Processing by AuthenticatedController#index as HTML
21
- Rendered text template (0.0ms)
22
- Filter chain halted as :authenticate_account! rendered or redirected
23
- Completed 200 OK in 7ms (Views: 7.2ms | ActiveRecord: 0.0ms)
24
-  (0.1ms) rollback transaction
25
-  (0.1ms) begin transaction
26
13
  Processing by AuthenticatedController#index as HTML
27
14
  Redirected to http://test.host/auth/bookingsync/?account_id=
28
15
  Filter chain halted as :authenticate_account! rendered or redirected
29
16
  Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
30
-  (0.0ms) rollback transaction
31
-  (0.0ms) begin transaction
32
- Processing by AuthenticatedController#index as JS
33
- Filter chain halted as :authenticate_account! rendered or redirected
34
- Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
35
17
   (0.0ms) rollback transaction
36
18
   (0.1ms) begin transaction
37
- Processing by AuthenticatedController#index as JS
19
+ Processing by AuthenticatedController#index as HTML
38
20
  Filter chain halted as :authenticate_account! rendered or redirected
39
- Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
21
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
40
22
   (0.0ms) rollback transaction
41
23
   (0.0ms) begin transaction
42
- Processing by SessionsController#failure as HTML
43
- Completed 200 OK in 2ms (Views: 2.3ms | ActiveRecord: 0.0ms)
44
-  (0.1ms) rollback transaction
45
-  (0.0ms) begin transaction
46
- Processing by SessionsController#failure as HTML
47
- Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
48
-  (0.1ms) rollback transaction
49
-  (0.0ms) begin transaction
50
24
  Processing by SessionsController#create as HTML
51
25
  Parameters: {"provider"=>"bookingsync"}
52
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
53
- SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
54
- Completed 500 Internal Server Error in 7ms
55
-  (0.1ms) rollback transaction
56
-  (0.1ms) begin transaction
26
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
27
+  (0.0ms) SAVEPOINT active_record_1
28
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
29
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.450447"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.450447"]]
30
+  (0.0ms) RELEASE SAVEPOINT active_record_1
31
+ Redirected to http://test.host/
32
+ Completed 302 Found in 15ms (ActiveRecord: 1.2ms)
33
+  (0.7ms) rollback transaction
34
+  (0.0ms) begin transaction
57
35
  Processing by SessionsController#create as HTML
58
36
  Parameters: {"provider"=>"bookingsync"}
59
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
60
- SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
61
- Completed 500 Internal Server Error in 1ms
62
-  (0.1ms) rollback transaction
63
-  (0.1ms) begin transaction
37
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
38
+  (0.0ms) SAVEPOINT active_record_1
39
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
40
+ 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-02-11 15:46:47.454804"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.454804"]]
41
+  (0.0ms) RELEASE SAVEPOINT active_record_1
42
+ Redirected to http://test.host/
43
+ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
44
+  (0.3ms) rollback transaction
45
+  (0.0ms) begin transaction
64
46
  Processing by SessionsController#create as HTML
65
47
  Parameters: {"provider"=>"bookingsync"}
66
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
67
- SQLite3::SQLException: no such table: accounts: SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
68
- Completed 500 Internal Server Error in 1ms
69
-  (0.0ms) rollback transaction
48
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
49
+  (0.0ms) SAVEPOINT active_record_1
50
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
51
+ 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-02-11 15:46:47.457947"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.457947"]]
52
+  (0.0ms) RELEASE SAVEPOINT active_record_1
53
+ Redirected to http://test.host/admin
54
+ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
55
+  (0.4ms) rollback transaction
70
56
   (0.0ms) begin transaction
71
57
  Processing by SessionsController#destroy as HTML
72
- Redirected to http://test.host/
58
+ Redirected to http://test.host/signed_out
73
59
  Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
74
60
   (0.0ms) rollback transaction
75
-  (0.1ms) begin transaction
61
+  (0.0ms) begin transaction
76
62
  Processing by SessionsController#destroy as HTML
77
- Redirected to http://test.host/signed_out
63
+ Redirected to http://test.host/
78
64
  Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
79
65
   (0.0ms) rollback transaction
80
-  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
81
-  (0.6ms) select sqlite_version(*)
82
-  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
83
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
84
- Migrating to CreateAccounts (20140522110326)
85
-  (0.1ms) begin transaction
86
-  (0.4ms) CREATE TABLE "accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)
87
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110326"]]
88
-  (1.2ms) commit transaction
89
- Migrating to AddOAuthFieldsToAccounts (20140522110454)
90
-  (0.0ms) begin transaction
91
-  (0.3ms) ALTER TABLE "accounts" ADD "provider" varchar(255)
92
-  (0.1ms) ALTER TABLE "accounts" ADD "uid" integer
93
-  (0.1ms) CREATE INDEX "index_accounts_on_uid" ON "accounts" ("uid")
94
-  (0.1ms) ALTER TABLE "accounts" ADD "name" varchar(255)
95
-  (0.1ms) ALTER TABLE "accounts" ADD "oauth_access_token" varchar(255)
96
-  (0.1ms) ALTER TABLE "accounts" ADD "oauth_refresh_token" varchar(255)
97
-  (0.2ms) ALTER TABLE "accounts" ADD "oauth_expires_at" varchar(255)
98
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140522110454"]]
99
-  (1.1ms) commit transaction
100
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
101
-  (0.1ms) SELECT sql
102
- FROM sqlite_master
103
- WHERE name='index_accounts_on_uid' AND type='index'
104
- UNION ALL
105
- SELECT sql
106
- FROM sqlite_temp_master
107
- WHERE name='index_accounts_on_uid' AND type='index'
108
-
109
-  (0.3ms) begin transaction
110
-  (0.1ms) rollback transaction
111
-  (0.1ms) begin transaction
66
+  (0.0ms) begin transaction
67
+ Processing by SessionsController#failure as HTML
68
+ Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)
69
+  (0.0ms) rollback transaction
70
+  (0.0ms) begin transaction
71
+ Processing by SessionsController#failure as HTML
72
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
73
+  (0.0ms) rollback transaction
74
+  (0.0ms) begin transaction
75
+  (0.0ms) rollback transaction
76
+  (0.0ms) begin transaction
77
+  (0.0ms) rollback transaction
78
+  (0.0ms) begin transaction
79
+  (0.0ms) rollback transaction
80
+  (0.0ms) begin transaction
81
+  (0.0ms) rollback transaction
82
+  (0.0ms) begin transaction
83
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
112
84
   (0.0ms) SAVEPOINT active_record_1
113
- SQL (0.6ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.780394"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.780394"]]
114
-  (0.1ms) RELEASE SAVEPOINT active_record_1
85
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-02-11 15:46:47.475554"], ["uid", 0], ["updated_at", "2015-02-11 15:46:47.475554"]]
86
+  (0.0ms) RELEASE SAVEPOINT active_record_1
87
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
88
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
89
+  (0.3ms) rollback transaction
90
+  (0.0ms) begin transaction
115
91
   (0.0ms) SAVEPOINT active_record_1
116
- SQL (1.0ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.786645"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.786645"]]
117
-  (0.1ms) RELEASE SAVEPOINT active_record_1
118
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
119
-  (0.1ms) SAVEPOINT active_record_1
120
- 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", "2014-11-21 18:50:45.794425"]]
121
-  (0.0ms) RELEASE SAVEPOINT active_record_1
122
-  (1.2ms) rollback transaction
123
-  (0.1ms) begin transaction
124
-  (0.0ms) SAVEPOINT active_record_1
125
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.798850"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.798850"]]
92
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
93
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.483734"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.483734"]]
126
94
   (0.0ms) RELEASE SAVEPOINT active_record_1
95
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
96
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
127
97
   (0.0ms) SAVEPOINT active_record_1
128
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.799982"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.799982"]]
98
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
99
+ 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-02-11 15:46:47.486462"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.486462"]]
100
+  (0.1ms) RELEASE SAVEPOINT active_record_1
101
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
102
+  (0.6ms) rollback transaction
103
+  (0.0ms) begin transaction
104
+  (0.0ms) SAVEPOINT active_record_1
105
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
106
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.488922"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.488922"]]
129
107
   (0.0ms) RELEASE SAVEPOINT active_record_1
130
108
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
131
109
   (0.0ms) SAVEPOINT active_record_1
132
- 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", "2014-11-21 18:50:45.801289"]]
133
-  (0.0ms) RELEASE SAVEPOINT active_record_1
134
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
135
-  (0.8ms) rollback transaction
110
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
111
+ 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-02-11 15:46:47.490168"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.490168"]]
112
+  (0.0ms) RELEASE SAVEPOINT active_record_1
113
+  (0.6ms) rollback transaction
136
114
   (0.0ms) begin transaction
137
-  (0.1ms) SAVEPOINT active_record_1
138
- SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.804516"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.804516"]]
139
-  (0.1ms) RELEASE SAVEPOINT active_record_1
140
-  (0.1ms) SAVEPOINT active_record_1
141
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.806672"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.806672"]]
142
-  (0.1ms) RELEASE SAVEPOINT active_record_1
143
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
144
-  (0.1ms) SAVEPOINT active_record_1
145
- 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", "2014-11-21 18:50:45.808967"]]
115
+  (0.0ms) SAVEPOINT active_record_1
116
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
117
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.492300"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.492300"]]
146
118
   (0.0ms) RELEASE SAVEPOINT active_record_1
147
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
148
-  (1.0ms) rollback transaction
119
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
120
+  (0.0ms) SAVEPOINT active_record_1
121
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
122
+ 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-02-11 15:46:47.493446"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.493446"]]
123
+  (0.0ms) RELEASE SAVEPOINT active_record_1
124
+  (0.5ms) rollback transaction
149
125
   (0.0ms) begin transaction
150
126
   (0.0ms) SAVEPOINT active_record_1
151
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.812120"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.812120"]]
152
-  (0.0ms) RELEASE SAVEPOINT active_record_1
153
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
154
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
155
-  (0.0ms) SAVEPOINT active_record_1
156
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.816763"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.816763"]]
127
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
128
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.495332"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.495332"]]
157
129
   (0.0ms) RELEASE SAVEPOINT active_record_1
158
-  (0.0ms) SELECT COUNT(*) FROM "accounts"
159
-  (0.9ms) rollback transaction
130
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
131
+  (0.0ms) SAVEPOINT active_record_1
132
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
133
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.496435"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.496435"]]
134
+  (0.0ms) RELEASE SAVEPOINT active_record_1
135
+  (0.5ms) rollback transaction
160
136
   (0.0ms) begin transaction
161
137
   (0.0ms) SAVEPOINT active_record_1
162
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.819979"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.819979"]]
163
-  (0.0ms) RELEASE SAVEPOINT active_record_1
164
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
165
-  (0.1ms) SAVEPOINT active_record_1
166
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.821634"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.821634"]]
138
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
139
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.498489"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.498489"]]
140
+  (0.0ms) RELEASE SAVEPOINT active_record_1
141
+  (0.0ms) SAVEPOINT active_record_1
142
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
143
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.499392"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.499392"]]
144
+  (0.0ms) RELEASE SAVEPOINT active_record_1
145
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
146
+  (0.0ms) SAVEPOINT active_record_1
147
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
148
+ 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-02-11 15:46:47.500921"]]
167
149
   (0.0ms) RELEASE SAVEPOINT active_record_1
168
150
   (0.6ms) rollback transaction
169
151
   (0.0ms) begin transaction
170
152
   (0.0ms) SAVEPOINT active_record_1
171
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.824314"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.824314"]]
172
-  (0.0ms) RELEASE SAVEPOINT active_record_1
173
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
153
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
154
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.503144"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.503144"]]
155
+  (0.0ms) RELEASE SAVEPOINT active_record_1
174
156
   (0.0ms) SAVEPOINT active_record_1
175
- 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", "2014-11-21 18:50:45.825706"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.825706"]]
176
-  (0.0ms) RELEASE SAVEPOINT active_record_1
177
-  (0.5ms) rollback transaction
178
-  (0.0ms) begin transaction
157
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
158
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.503952"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.503952"]]
159
+  (0.0ms) RELEASE SAVEPOINT active_record_1
160
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
179
161
   (0.0ms) SAVEPOINT active_record_1
180
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.827766"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:50:45.827766"]]
162
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
163
+ 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-02-11 15:46:47.505075"]]
164
+  (0.0ms) RELEASE SAVEPOINT active_record_1
165
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
166
+  (0.6ms) rollback transaction
167
+  (0.0ms) begin transaction
168
+  (0.0ms) SAVEPOINT active_record_1
169
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
170
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.506981"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:46:47.506981"]]
171
+  (0.0ms) RELEASE SAVEPOINT active_record_1
172
+  (0.0ms) SAVEPOINT active_record_1
173
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
174
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.507829"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:46:47.507829"]]
181
175
   (0.0ms) RELEASE SAVEPOINT active_record_1
182
176
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
183
177
   (0.0ms) SAVEPOINT active_record_1
184
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.829699"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.829699"]]
178
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
179
+ 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-02-11 15:46:47.508930"]]
180
+  (0.0ms) RELEASE SAVEPOINT active_record_1
181
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
182
+  (0.6ms) rollback transaction
183
+  (0.0ms) begin transaction
184
+  (0.0ms) rollback transaction
185
+  (0.0ms) begin transaction
186
+  (0.0ms) SAVEPOINT active_record_1
187
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
188
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-02-11 15:46:47.514663"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-02-11 15:46:47.514663"]]
185
189
   (0.0ms) RELEASE SAVEPOINT active_record_1
186
-  (0.8ms) rollback transaction
187
-  (0.1ms) begin transaction
188
190
   (0.0ms) SAVEPOINT active_record_1
189
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.833159"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2014-11-21 18:50:45.833159"]]
190
-  (0.0ms) RELEASE SAVEPOINT active_record_1
191
-  (0.0ms) SAVEPOINT active_record_1
192
- SQL (0.3ms) 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", "2014-11-21 18:50:45.834209"]]
191
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
192
+ SQL (1.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-02-11 15:46:47.515717"]]
193
193
   (0.0ms) RELEASE SAVEPOINT active_record_1
194
194
  Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
195
-  (0.8ms) rollback transaction
196
-  (0.0ms) begin transaction
195
+  (4.8ms) rollback transaction
196
+  (0.2ms) begin transaction
197
197
  Processing by AuthenticatedController#index as HTML
198
198
  Rendered text template (0.0ms)
199
199
  Filter chain halted as :authenticate_account! rendered or redirected
200
- Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms)
201
-  (0.1ms) rollback transaction
202
-  (0.1ms) begin transaction
200
+ Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)
201
+  (0.0ms) rollback transaction
202
+  (0.0ms) begin transaction
203
203
  Processing by AuthenticatedController#index as HTML
204
204
  Redirected to http://test.host/auth/bookingsync/?account_id=
205
205
  Filter chain halted as :authenticate_account! rendered or redirected
206
206
  Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
207
-  (0.1ms) rollback transaction
208
-  (0.0ms) begin transaction
207
+  (0.0ms) rollback transaction
208
+  (0.0ms) begin transaction
209
209
  Processing by AuthenticatedController#index as JS
210
210
  Filter chain halted as :authenticate_account! rendered or redirected
211
- Completed 401 Unauthorized in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
212
-  (0.0ms) rollback transaction
213
-  (0.0ms) begin transaction
211
+ Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
212
+  (0.0ms) rollback transaction
213
+  (0.0ms) begin transaction
214
214
  Processing by AuthenticatedController#index as JS
215
215
  Filter chain halted as :authenticate_account! rendered or redirected
216
- Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
217
-  (0.0ms) rollback transaction
216
+ Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
217
+  (0.0ms) rollback transaction
218
+  (0.0ms) begin transaction
219
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
220
+  (0.0ms) SAVEPOINT active_record_1
221
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-02-11 15:49:40.531833"], ["uid", 0], ["updated_at", "2015-02-11 15:49:40.531833"]]
222
+  (0.0ms) RELEASE SAVEPOINT active_record_1
223
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
224
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
225
+  (0.5ms) rollback transaction
226
+  (0.0ms) begin transaction
227
+  (0.0ms) SAVEPOINT active_record_1
228
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
229
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.544303"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-02-11 15:49:40.544303"]]
230
+  (0.0ms) RELEASE SAVEPOINT active_record_1
231
+  (0.0ms) SAVEPOINT active_record_1
232
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
233
+ SQL (0.3ms) 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-02-11 15:49:40.545706"]]
234
+  (0.0ms) RELEASE SAVEPOINT active_record_1
235
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
236
+  (0.5ms) rollback transaction
218
237
   (0.0ms) begin transaction
219
- Processing by SessionsController#failure as HTML
220
- Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
221
-  (0.1ms) rollback transaction
238
+  (0.0ms) rollback transaction
222
239
   (0.0ms) begin transaction
223
- Processing by SessionsController#failure as HTML
224
- Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
225
-  (0.1ms) rollback transaction
226
-  (0.1ms) begin transaction
227
- Processing by SessionsController#create as HTML
228
- Parameters: {"provider"=>"bookingsync"}
229
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
230
-  (0.1ms) SAVEPOINT active_record_1
231
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:50:45.866487"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.866487"]]
240
+  (0.0ms) SAVEPOINT active_record_1
241
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
242
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.555312"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.555312"]]
232
243
   (0.0ms) RELEASE SAVEPOINT active_record_1
233
- Redirected to http://test.host/admin
234
- Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
235
-  (0.5ms) rollback transaction
236
-  (0.0ms) begin transaction
237
- Processing by SessionsController#create as HTML
238
- Parameters: {"provider"=>"bookingsync"}
239
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
240
-  (0.1ms) SAVEPOINT active_record_1
241
- 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", "2014-11-21 18:50:45.871743"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.871743"]]
244
+  (0.0ms) SAVEPOINT active_record_1
245
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
246
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.556260"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.556260"]]
242
247
   (0.0ms) RELEASE SAVEPOINT active_record_1
243
- Redirected to http://test.host/
244
- Completed 302 Found in 2ms (ActiveRecord: 0.5ms)
245
-  (0.6ms) rollback transaction
246
-  (0.0ms) begin transaction
247
- Processing by SessionsController#create as HTML
248
- Parameters: {"provider"=>"bookingsync"}
249
248
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
250
249
   (0.0ms) SAVEPOINT active_record_1
251
- 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", "2014-11-21 18:50:45.876634"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:50:45.876634"]]
252
-  (0.0ms) RELEASE SAVEPOINT active_record_1
253
- Redirected to http://test.host/
254
- Completed 302 Found in 2ms (ActiveRecord: 0.4ms)
255
-  (0.4ms) rollback transaction
256
-  (0.1ms) begin transaction
257
- Processing by SessionsController#destroy as HTML
258
- Redirected to http://test.host/
259
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
260
-  (0.1ms) rollback transaction
261
-  (0.0ms) begin transaction
262
- Processing by SessionsController#destroy as HTML
263
- Redirected to http://test.host/signed_out
264
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
265
-  (0.0ms) rollback transaction
266
-  (0.3ms) begin transaction
267
- Processing by AuthenticatedController#index as HTML
268
- Rendered text template (0.0ms)
269
- Filter chain halted as :authenticate_account! rendered or redirected
270
- Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms)
271
-  (0.1ms) rollback transaction
272
-  (0.1ms) begin transaction
273
- Processing by AuthenticatedController#index as HTML
274
- Redirected to http://test.host/auth/bookingsync/?account_id=
275
- Filter chain halted as :authenticate_account! rendered or redirected
276
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
277
-  (0.1ms) rollback transaction
278
-  (0.1ms) begin transaction
279
- Processing by AuthenticatedController#index as JS
280
- Filter chain halted as :authenticate_account! rendered or redirected
281
- Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
282
-  (0.1ms) rollback transaction
283
-  (0.0ms) begin transaction
284
- Processing by AuthenticatedController#index as JS
285
- Filter chain halted as :authenticate_account! rendered or redirected
286
- Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
287
-  (0.0ms) rollback transaction
250
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
251
+ 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-02-11 15:49:40.559001"]]
252
+  (0.0ms) RELEASE SAVEPOINT active_record_1
253
+  (0.5ms) rollback transaction
288
254
   (0.0ms) begin transaction
289
-  (0.1ms) SAVEPOINT active_record_1
255
+  (0.0ms) SAVEPOINT active_record_1
290
256
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
291
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.235971"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.235971"]]
257
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.561107"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.561107"]]
292
258
   (0.0ms) RELEASE SAVEPOINT active_record_1
293
259
   (0.0ms) SAVEPOINT active_record_1
294
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
295
- SQL (1.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.238044"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.238044"]]
296
-  (0.1ms) RELEASE SAVEPOINT active_record_1
260
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
261
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.561907"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.561907"]]
262
+  (0.0ms) RELEASE SAVEPOINT active_record_1
297
263
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
298
264
   (0.0ms) SAVEPOINT active_record_1
299
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
300
- 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", "2014-11-21 18:53:13.245297"]]
301
-  (0.0ms) RELEASE SAVEPOINT active_record_1
302
-  (0.8ms) rollback transaction
303
-  (0.1ms) begin transaction
304
-  (0.0ms) SAVEPOINT active_record_1
305
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
306
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.249694"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.249694"]]
307
-  (0.0ms) RELEASE SAVEPOINT active_record_1
308
-  (0.0ms) SAVEPOINT active_record_1
309
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
310
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.251458"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.251458"]]
265
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
266
+ 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-02-11 15:49:40.563009"]]
311
267
   (0.0ms) RELEASE SAVEPOINT active_record_1
312
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
268
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
269
+  (0.5ms) rollback transaction
270
+  (0.0ms) begin transaction
313
271
   (0.0ms) SAVEPOINT active_record_1
314
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
315
- 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", "2014-11-21 18:53:13.253535"]]
272
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
273
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.564753"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.564753"]]
316
274
   (0.0ms) RELEASE SAVEPOINT active_record_1
317
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
318
-  (0.8ms) rollback transaction
319
-  (0.0ms) begin transaction
320
-  (0.0ms) SAVEPOINT active_record_1
321
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
322
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.256633"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.256633"]]
323
-  (0.0ms) RELEASE SAVEPOINT active_record_1
324
-  (0.0ms) SAVEPOINT active_record_1
325
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
326
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.258180"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.258180"]]
327
-  (0.0ms) RELEASE SAVEPOINT active_record_1
328
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
329
275
   (0.0ms) SAVEPOINT active_record_1
330
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
331
- 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", "2014-11-21 18:53:13.260239"]]
276
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
277
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.565494"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.565494"]]
332
278
   (0.0ms) RELEASE SAVEPOINT active_record_1
333
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
334
-  (0.9ms) rollback transaction
335
-  (0.0ms) begin transaction
279
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
336
280
   (0.0ms) SAVEPOINT active_record_1
337
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
338
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.263399"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.263399"]]
339
-  (0.0ms) RELEASE SAVEPOINT active_record_1
340
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
341
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
342
-  (0.0ms) SAVEPOINT active_record_1
343
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
344
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.267292"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.267292"]]
281
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
282
+ 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-02-11 15:49:40.566666"]]
345
283
   (0.0ms) RELEASE SAVEPOINT active_record_1
346
-  (0.3ms) SELECT COUNT(*) FROM "accounts"
347
-  (0.9ms) rollback transaction
348
-  (0.1ms) begin transaction
284
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
285
+  (0.5ms) rollback transaction
286
+  (0.0ms) begin transaction
349
287
   (0.0ms) SAVEPOINT active_record_1
350
288
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
351
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.272258"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.272258"]]
289
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.568805"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.568805"]]
352
290
   (0.0ms) RELEASE SAVEPOINT active_record_1
353
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
291
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
292
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
293
+  (0.0ms) SAVEPOINT active_record_1
294
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
295
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.571337"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.571337"]]
296
+  (0.0ms) RELEASE SAVEPOINT active_record_1
297
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
298
+  (0.5ms) rollback transaction
299
+  (0.0ms) begin transaction
354
300
   (0.0ms) SAVEPOINT active_record_1
355
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
356
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.274126"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.274126"]]
301
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
302
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.573462"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.573462"]]
357
303
   (0.0ms) RELEASE SAVEPOINT active_record_1
358
-  (0.9ms) rollback transaction
359
-  (0.1ms) begin transaction
360
-  (0.1ms) SAVEPOINT active_record_1
361
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
362
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.277779"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.277779"]]
363
-  (0.1ms) RELEASE SAVEPOINT active_record_1
364
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
304
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
365
305
   (0.0ms) SAVEPOINT active_record_1
366
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
367
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.280537"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.280537"]]
306
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
307
+ 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-02-11 15:49:40.574490"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.574490"]]
368
308
   (0.0ms) RELEASE SAVEPOINT active_record_1
369
-  (0.9ms) rollback transaction
370
-  (0.1ms) begin transaction
309
+  (0.5ms) rollback transaction
310
+  (0.0ms) begin transaction
371
311
   (0.0ms) SAVEPOINT active_record_1
372
312
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
373
- SQL (0.5ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.284089"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:13.284089"]]
313
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.576222"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.576222"]]
374
314
   (0.0ms) RELEASE SAVEPOINT active_record_1
375
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
315
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
376
316
   (0.0ms) SAVEPOINT active_record_1
377
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
378
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.286758"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.286758"]]
317
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
318
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.577248"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.577248"]]
379
319
   (0.0ms) RELEASE SAVEPOINT active_record_1
380
-  (0.9ms) rollback transaction
320
+  (0.4ms) rollback transaction
381
321
   (0.0ms) begin transaction
382
-  (0.1ms) rollback transaction
383
-  (0.1ms) begin transaction
384
-  (0.1ms) SAVEPOINT active_record_1
385
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
386
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.303051"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2014-11-21 18:53:13.303051"]]
387
-  (0.0ms) RELEASE SAVEPOINT active_record_1
388
322
   (0.0ms) SAVEPOINT active_record_1
389
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
390
- SQL (0.3ms) 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", "2014-11-21 18:53:13.304418"]]
323
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
324
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-11 15:49:40.579157"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-11 15:49:40.579157"]]
391
325
   (0.0ms) RELEASE SAVEPOINT active_record_1
392
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
393
-  (0.8ms) rollback transaction
326
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
327
+  (0.0ms) SAVEPOINT active_record_1
328
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
329
+ 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-02-11 15:49:40.580226"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.580226"]]
330
+  (0.0ms) RELEASE SAVEPOINT active_record_1
331
+  (0.5ms) rollback transaction
332
+  (0.0ms) begin transaction
333
+  (0.0ms) rollback transaction
334
+  (0.0ms) begin transaction
335
+  (0.0ms) rollback transaction
336
+  (0.0ms) begin transaction
337
+  (0.0ms) rollback transaction
338
+  (0.0ms) begin transaction
339
+  (0.0ms) rollback transaction
394
340
   (0.0ms) begin transaction
395
341
  Processing by SessionsController#create as HTML
396
342
  Parameters: {"provider"=>"bookingsync"}
397
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
398
-  (0.1ms) SAVEPOINT active_record_1
343
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
344
+  (0.0ms) SAVEPOINT active_record_1
399
345
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
400
- 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", "2014-11-21 18:53:13.311144"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.311144"]]
401
-  (0.0ms) RELEASE SAVEPOINT active_record_1
346
+ 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-02-11 15:49:40.588056"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.588056"]]
347
+  (0.4ms) RELEASE SAVEPOINT active_record_1
402
348
  Redirected to http://test.host/
403
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
404
-  (0.5ms) rollback transaction
349
+ Completed 302 Found in 2ms (ActiveRecord: 0.7ms)
350
+  (0.4ms) rollback transaction
405
351
   (0.0ms) begin transaction
406
352
  Processing by SessionsController#create as HTML
407
353
  Parameters: {"provider"=>"bookingsync"}
408
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
354
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
409
355
   (0.0ms) SAVEPOINT active_record_1
410
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
411
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:13.317363"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.317363"]]
412
-  (0.0ms) RELEASE SAVEPOINT active_record_1
356
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
357
+ 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-02-11 15:49:40.591910"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.591910"]]
358
+  (0.1ms) RELEASE SAVEPOINT active_record_1
413
359
  Redirected to http://test.host/admin
414
- Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
415
-  (0.5ms) rollback transaction
360
+ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
361
+  (0.3ms) rollback transaction
416
362
   (0.0ms) begin transaction
417
363
  Processing by SessionsController#create as HTML
418
364
  Parameters: {"provider"=>"bookingsync"}
419
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
420
-  (0.1ms) SAVEPOINT active_record_1
365
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
366
+  (0.0ms) SAVEPOINT active_record_1
421
367
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
422
- 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", "2014-11-21 18:53:13.322915"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:13.322915"]]
368
+ 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-02-11 15:49:40.594608"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-11 15:49:40.594608"]]
423
369
   (0.0ms) RELEASE SAVEPOINT active_record_1
424
370
  Redirected to http://test.host/
425
- Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
426
-  (0.5ms) rollback transaction
427
-  (0.1ms) begin transaction
371
+ Completed 302 Found in 1ms (ActiveRecord: 0.3ms)
372
+  (0.3ms) rollback transaction
373
+  (0.0ms) begin transaction
428
374
  Processing by SessionsController#failure as HTML
429
- Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)
430
-  (0.1ms) rollback transaction
431
-  (0.1ms) begin transaction
375
+ Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)
376
+  (0.0ms) rollback transaction
377
+  (0.0ms) begin transaction
432
378
  Processing by SessionsController#failure as HTML
433
- Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
379
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
434
380
   (0.0ms) rollback transaction
435
381
   (0.1ms) begin transaction
436
382
  Processing by SessionsController#destroy as HTML
437
383
  Redirected to http://test.host/
438
384
  Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
439
385
   (0.0ms) rollback transaction
440
-  (0.1ms) begin transaction
441
- Processing by SessionsController#destroy as HTML
442
- Redirected to http://test.host/signed_out
443
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
444
-  (0.1ms) rollback transaction
445
-  (0.3ms) begin transaction
386
+  (0.0ms) begin transaction
446
387
  Processing by SessionsController#destroy as HTML
447
388
  Redirected to http://test.host/signed_out
448
389
  Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
449
-  (0.1ms) rollback transaction
450
-  (0.1ms) begin transaction
451
- Processing by SessionsController#destroy as HTML
452
- Redirected to http://test.host/
453
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
454
-  (0.1ms) rollback transaction
455
-  (0.1ms) begin transaction
456
- Processing by SessionsController#failure as HTML
457
- Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms)
458
-  (0.1ms) rollback transaction
390
+  (0.0ms) rollback transaction
391
+  (0.2ms) begin transaction
392
+  (0.0ms) rollback transaction
459
393
   (0.0ms) begin transaction
460
- Processing by SessionsController#failure as HTML
461
- Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
462
-  (0.1ms) rollback transaction
394
+  (0.0ms) rollback transaction
463
395
   (0.0ms) begin transaction
464
- Processing by SessionsController#create as HTML
465
- Parameters: {"provider"=>"bookingsync"}
466
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
467
-  (0.1ms) SAVEPOINT active_record_1
468
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
469
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.186868"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.186868"]]
470
-  (0.0ms) RELEASE SAVEPOINT active_record_1
471
- Redirected to http://test.host/
472
- Completed 302 Found in 28ms (ActiveRecord: 2.1ms)
473
-  (1.7ms) rollback transaction
474
-  (0.1ms) begin transaction
475
- Processing by SessionsController#create as HTML
476
- Parameters: {"provider"=>"bookingsync"}
477
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
396
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
397
+  (0.0ms) SAVEPOINT active_record_1
398
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-02-12 20:01:06.371988"], ["uid", 0], ["updated_at", "2015-02-12 20:01:06.371988"]]
399
+  (0.0ms) RELEASE SAVEPOINT active_record_1
400
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
401
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
402
+  (0.4ms) rollback transaction
403
+  (0.0ms) begin transaction
404
+  (0.0ms) SAVEPOINT active_record_1
405
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
406
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.389273"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.389273"]]
407
+  (0.0ms) RELEASE SAVEPOINT active_record_1
478
408
   (0.0ms) SAVEPOINT active_record_1
479
409
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
480
- 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", "2014-11-21 18:53:57.194079"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.194079"]]
410
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.390208"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.390208"]]
481
411
   (0.0ms) RELEASE SAVEPOINT active_record_1
482
- Redirected to http://test.host/admin
483
- Completed 302 Found in 2ms (ActiveRecord: 0.5ms)
484
-  (0.6ms) rollback transaction
485
-  (0.1ms) begin transaction
486
- Processing by SessionsController#create as HTML
487
- Parameters: {"provider"=>"bookingsync"}
488
412
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
489
413
   (0.0ms) SAVEPOINT active_record_1
490
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
491
- 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", "2014-11-21 18:53:57.199628"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.199628"]]
492
-  (0.1ms) RELEASE SAVEPOINT active_record_1
493
- Redirected to http://test.host/
494
- Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
495
-  (0.4ms) rollback transaction
414
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
415
+ 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-02-12 20:01:06.394590"]]
416
+  (0.0ms) RELEASE SAVEPOINT active_record_1
417
+  (0.6ms) rollback transaction
496
418
   (0.0ms) begin transaction
497
-  (0.1ms) rollback transaction
498
-  (0.1ms) begin transaction
499
-  (0.1ms) SAVEPOINT active_record_1
500
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
501
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.209916"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.209916"]]
419
+  (0.0ms) SAVEPOINT active_record_1
420
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
421
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.397910"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.397910"]]
422
+  (0.0ms) RELEASE SAVEPOINT active_record_1
423
+  (0.0ms) SAVEPOINT active_record_1
424
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
425
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.398765"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.398765"]]
426
+  (0.0ms) RELEASE SAVEPOINT active_record_1
427
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
428
+  (0.0ms) SAVEPOINT active_record_1
429
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
430
+ 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-02-12 20:01:06.399960"]]
431
+  (0.0ms) RELEASE SAVEPOINT active_record_1
432
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
433
+  (0.5ms) rollback transaction
434
+  (0.0ms) begin transaction
435
+  (0.0ms) SAVEPOINT active_record_1
436
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
437
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.401788"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.401788"]]
502
438
   (0.0ms) RELEASE SAVEPOINT active_record_1
503
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
504
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
505
439
   (0.0ms) SAVEPOINT active_record_1
506
440
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
507
- SQL (1.0ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.214852"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.214852"]]
508
-  (0.1ms) RELEASE SAVEPOINT active_record_1
509
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
510
-  (0.9ms) rollback transaction
511
-  (0.1ms) begin transaction
441
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.402598"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.402598"]]
442
+  (0.0ms) RELEASE SAVEPOINT active_record_1
443
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
512
444
   (0.0ms) SAVEPOINT active_record_1
513
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
514
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.219610"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.219610"]]
445
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
446
+ 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-02-12 20:01:06.403630"]]
515
447
   (0.0ms) RELEASE SAVEPOINT active_record_1
448
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
449
+  (0.6ms) rollback transaction
450
+  (0.0ms) begin transaction
451
+  (0.0ms) SAVEPOINT active_record_1
452
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
453
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.405479"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.405479"]]
454
+  (0.0ms) RELEASE SAVEPOINT active_record_1
455
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
516
456
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
517
457
   (0.0ms) SAVEPOINT active_record_1
518
458
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
519
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.221478"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.221478"]]
459
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.408899"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.408899"]]
520
460
   (0.0ms) RELEASE SAVEPOINT active_record_1
521
-  (1.2ms) rollback transaction
522
-  (0.1ms) begin transaction
523
-  (0.1ms) SAVEPOINT active_record_1
524
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
525
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.226954"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.226954"]]
526
-  (0.1ms) RELEASE SAVEPOINT active_record_1
527
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
528
-  (0.1ms) SAVEPOINT active_record_1
529
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
530
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.230154"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.230154"]]
531
-  (0.1ms) RELEASE SAVEPOINT active_record_1
532
-  (0.8ms) rollback transaction
533
-  (0.1ms) begin transaction
534
-  (0.1ms) SAVEPOINT active_record_1
535
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
536
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.234384"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.234384"]]
461
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
462
+  (0.5ms) rollback transaction
463
+  (0.0ms) begin transaction
464
+  (0.0ms) SAVEPOINT active_record_1
465
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
466
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.411202"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.411202"]]
537
467
   (0.0ms) RELEASE SAVEPOINT active_record_1
538
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
539
-  (0.1ms) SAVEPOINT active_record_1
540
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
541
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.236869"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.236869"]]
468
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
469
+  (0.0ms) SAVEPOINT active_record_1
470
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
471
+ 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-02-12 20:01:06.412254"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.412254"]]
542
472
   (0.0ms) RELEASE SAVEPOINT active_record_1
543
-  (0.7ms) rollback transaction
544
-  (0.1ms) begin transaction
473
+  (0.5ms) rollback transaction
474
+  (0.0ms) begin transaction
545
475
   (0.0ms) SAVEPOINT active_record_1
546
476
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
547
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.240331"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.240331"]]
548
-  (0.1ms) RELEASE SAVEPOINT active_record_1
549
-  (0.0ms) SAVEPOINT active_record_1
550
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
551
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.241829"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.241829"]]
477
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.414042"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.414042"]]
552
478
   (0.0ms) RELEASE SAVEPOINT active_record_1
553
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
479
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
554
480
   (0.0ms) SAVEPOINT active_record_1
555
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
556
- 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", "2014-11-21 18:53:57.244097"]]
481
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
482
+ 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-02-12 20:01:06.415033"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.415033"]]
557
483
   (0.0ms) RELEASE SAVEPOINT active_record_1
558
-  (0.9ms) rollback transaction
484
+  (0.4ms) rollback transaction
559
485
   (0.0ms) begin transaction
560
486
   (0.0ms) SAVEPOINT active_record_1
561
487
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
562
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.247595"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.247595"]]
563
-  (0.1ms) RELEASE SAVEPOINT active_record_1
564
-  (0.1ms) SAVEPOINT active_record_1
565
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
566
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.249738"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.249738"]]
488
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.416719"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:06.416719"]]
567
489
   (0.0ms) RELEASE SAVEPOINT active_record_1
568
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
490
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
569
491
   (0.0ms) SAVEPOINT active_record_1
570
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
571
- 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", "2014-11-21 18:53:57.251701"]]
492
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
493
+ SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.417803"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:06.417803"]]
572
494
   (0.0ms) RELEASE SAVEPOINT active_record_1
573
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
574
-  (0.8ms) rollback transaction
575
-  (0.0ms) begin transaction
495
+  (0.6ms) rollback transaction
496
+  (0.0ms) begin transaction
497
+  (0.0ms) SAVEPOINT active_record_1
498
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
499
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:06.420932"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-02-12 20:01:06.420932"]]
500
+  (0.0ms) RELEASE SAVEPOINT active_record_1
501
+  (0.0ms) SAVEPOINT active_record_1
502
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
503
+ SQL (0.3ms) 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-02-12 20:01:06.422276"]]
504
+  (0.0ms) RELEASE SAVEPOINT active_record_1
505
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
506
+  (0.5ms) rollback transaction
507
+  (0.2ms) begin transaction
576
508
   (0.0ms) SAVEPOINT active_record_1
577
509
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
578
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.254826"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:53:57.254826"]]
510
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.852149"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.852149"]]
579
511
   (0.0ms) RELEASE SAVEPOINT active_record_1
580
-  (0.1ms) SAVEPOINT active_record_1
512
+  (0.0ms) SAVEPOINT active_record_1
581
513
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
582
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.256169"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:53:57.256169"]]
514
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.853500"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.853500"]]
583
515
   (0.0ms) RELEASE SAVEPOINT active_record_1
584
516
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
585
517
   (0.0ms) SAVEPOINT active_record_1
586
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
587
- 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", "2014-11-21 18:53:57.257947"]]
518
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
519
+ 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-02-12 20:01:24.857196"]]
588
520
   (0.0ms) RELEASE SAVEPOINT active_record_1
589
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
590
-  (1.0ms) rollback transaction
591
-  (0.1ms) begin transaction
592
-  (0.1ms) SAVEPOINT active_record_1
593
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
594
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:53:57.262627"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2014-11-21 18:53:57.262627"]]
595
-  (0.1ms) RELEASE SAVEPOINT active_record_1
596
-  (0.1ms) SAVEPOINT active_record_1
597
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
598
- SQL (0.4ms) 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", "2014-11-21 18:53:57.265090"]]
521
+  (0.6ms) rollback transaction
522
+  (0.0ms) begin transaction
523
+  (0.0ms) SAVEPOINT active_record_1
524
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
525
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.860005"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.860005"]]
526
+  (0.0ms) RELEASE SAVEPOINT active_record_1
527
+  (0.0ms) SAVEPOINT active_record_1
528
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
529
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.860892"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.860892"]]
530
+  (0.0ms) RELEASE SAVEPOINT active_record_1
531
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
532
+  (0.0ms) SAVEPOINT active_record_1
533
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
534
+ 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-02-12 20:01:24.862066"]]
599
535
   (0.0ms) RELEASE SAVEPOINT active_record_1
600
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
601
-  (0.9ms) rollback transaction
602
-  (0.1ms) begin transaction
603
-  (0.1ms) rollback transaction
604
-  (0.1ms) begin transaction
605
- Processing by AuthenticatedController#index as JS
606
- Filter chain halted as :authenticate_account! rendered or redirected
607
- Completed 401 Unauthorized in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
608
-  (0.1ms) rollback transaction
536
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
537
+  (0.6ms) rollback transaction
609
538
   (0.0ms) begin transaction
610
- Processing by AuthenticatedController#index as JS
611
- Filter chain halted as :authenticate_account! rendered or redirected
612
- Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
613
-  (0.1ms) rollback transaction
614
-  (0.1ms) begin transaction
615
- Processing by AuthenticatedController#index as HTML
616
- Redirected to http://test.host/auth/bookingsync/?account_id=
617
- Filter chain halted as :authenticate_account! rendered or redirected
618
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
619
-  (0.1ms) rollback transaction
620
-  (0.1ms) begin transaction
621
- Processing by AuthenticatedController#index as HTML
622
- Filter chain halted as :authenticate_account! rendered or redirected
623
- Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
624
-  (0.1ms) rollback transaction
625
-  (0.3ms) begin transaction
626
- Processing by SessionsController#destroy as HTML
627
- Redirected to http://test.host/signed_out
628
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
629
-  (0.1ms) rollback transaction
630
-  (0.0ms) begin transaction
631
- Processing by SessionsController#destroy as HTML
632
- Redirected to http://test.host/
633
- Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
634
-  (0.1ms) rollback transaction
635
-  (0.1ms) begin transaction
636
- Processing by SessionsController#create as HTML
637
- Parameters: {"provider"=>"bookingsync"}
638
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
639
-  (0.1ms) SAVEPOINT active_record_1
640
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
641
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.186376"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.186376"]]
642
-  (0.1ms) RELEASE SAVEPOINT active_record_1
643
- Redirected to http://test.host/
644
- Completed 302 Found in 31ms (ActiveRecord: 2.6ms)
645
-  (1.8ms) rollback transaction
646
-  (0.1ms) begin transaction
647
- Processing by SessionsController#create as HTML
648
- Parameters: {"provider"=>"bookingsync"}
649
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
539
+  (0.0ms) SAVEPOINT active_record_1
540
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
541
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.864769"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.864769"]]
542
+  (0.0ms) RELEASE SAVEPOINT active_record_1
543
+  (0.0ms) SAVEPOINT active_record_1
544
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
545
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.865648"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.865648"]]
546
+  (0.0ms) RELEASE SAVEPOINT active_record_1
547
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
650
548
   (0.0ms) SAVEPOINT active_record_1
651
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
652
- 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", "2014-11-21 18:54:55.194443"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.194443"]]
549
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
550
+ 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-02-12 20:01:24.866777"]]
653
551
   (0.0ms) RELEASE SAVEPOINT active_record_1
654
- Redirected to http://test.host/
655
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
656
-  (0.5ms) rollback transaction
657
-  (0.0ms) begin transaction
658
- Processing by SessionsController#create as HTML
659
- Parameters: {"provider"=>"bookingsync"}
660
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
661
-  (0.1ms) SAVEPOINT active_record_1
662
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
663
- 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", "2014-11-21 18:54:55.200615"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.200615"]]
664
-  (0.0ms) RELEASE SAVEPOINT active_record_1
665
- Redirected to http://test.host/admin
666
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
552
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
667
553
   (0.5ms) rollback transaction
668
-  (0.1ms) begin transaction
669
- Processing by SessionsController#failure as HTML
670
- Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)
671
-  (0.1ms) rollback transaction
672
-  (0.1ms) begin transaction
673
- Processing by SessionsController#failure as HTML
674
- Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
675
-  (0.1ms) rollback transaction
676
554
   (0.0ms) begin transaction
677
- Processing by AuthenticatedController#index as JS
678
- Filter chain halted as :authenticate_account! rendered or redirected
679
- Completed 401 Unauthorized in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)
680
-  (0.1ms) rollback transaction
681
-  (0.1ms) begin transaction
682
- Processing by AuthenticatedController#index as JS
683
- Filter chain halted as :authenticate_account! rendered or redirected
684
- Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
685
-  (0.1ms) rollback transaction
686
-  (0.1ms) begin transaction
687
- Processing by AuthenticatedController#index as HTML
688
- Redirected to http://test.host/auth/bookingsync/?account_id=
689
- Filter chain halted as :authenticate_account! rendered or redirected
690
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
691
-  (0.1ms) rollback transaction
692
-  (0.1ms) begin transaction
693
- Processing by AuthenticatedController#index as HTML
694
- Filter chain halted as :authenticate_account! rendered or redirected
695
- Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
696
-  (0.1ms) rollback transaction
697
-  (0.1ms) begin transaction
698
555
   (0.0ms) SAVEPOINT active_record_1
699
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
700
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.233080"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.233080"]]
701
-  (0.1ms) RELEASE SAVEPOINT active_record_1
702
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
703
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
556
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
557
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.869347"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.869347"]]
558
+  (0.0ms) RELEASE SAVEPOINT active_record_1
559
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
560
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
704
561
   (0.0ms) SAVEPOINT active_record_1
705
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
706
- 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", "2014-11-21 18:54:55.237602"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.237602"]]
707
-  (0.1ms) RELEASE SAVEPOINT active_record_1
708
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
709
-  (1.2ms) rollback transaction
710
-  (0.1ms) begin transaction
711
-  (0.1ms) SAVEPOINT active_record_1
712
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
713
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.243119"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.243119"]]
562
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
563
+ 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-02-12 20:01:24.871921"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.871921"]]
564
+  (0.0ms) RELEASE SAVEPOINT active_record_1
565
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
566
+  (0.6ms) rollback transaction
567
+  (0.0ms) begin transaction
568
+  (0.0ms) SAVEPOINT active_record_1
569
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
570
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.874052"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.874052"]]
714
571
   (0.0ms) RELEASE SAVEPOINT active_record_1
715
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
572
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
716
573
   (0.0ms) SAVEPOINT active_record_1
717
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
718
- 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", "2014-11-21 18:54:55.245320"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.245320"]]
574
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
575
+ 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-02-12 20:01:24.875093"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.875093"]]
719
576
   (0.0ms) RELEASE SAVEPOINT active_record_1
720
-  (0.9ms) rollback transaction
577
+  (0.5ms) rollback transaction
721
578
   (0.0ms) begin transaction
722
579
   (0.0ms) SAVEPOINT active_record_1
723
580
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
724
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.248781"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.248781"]]
581
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.876954"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.876954"]]
725
582
   (0.0ms) RELEASE SAVEPOINT active_record_1
726
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
583
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
727
584
   (0.0ms) SAVEPOINT active_record_1
728
585
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
729
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.250574"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.250574"]]
586
+ 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-02-12 20:01:24.877964"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.877964"]]
730
587
   (0.0ms) RELEASE SAVEPOINT active_record_1
731
-  (0.8ms) rollback transaction
588
+  (0.5ms) rollback transaction
732
589
   (0.0ms) begin transaction
733
590
   (0.0ms) SAVEPOINT active_record_1
734
591
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
735
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.253512"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.253512"]]
736
-  (0.1ms) RELEASE SAVEPOINT active_record_1
737
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
738
-  (0.1ms) SAVEPOINT active_record_1
592
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.879669"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:01:24.879669"]]
593
+  (0.0ms) RELEASE SAVEPOINT active_record_1
594
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
595
+  (0.0ms) SAVEPOINT active_record_1
739
596
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
740
- 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", "2014-11-21 18:54:55.255095"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.255095"]]
597
+ 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-02-12 20:01:24.880708"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.880708"]]
741
598
   (0.0ms) RELEASE SAVEPOINT active_record_1
742
-  (0.6ms) rollback transaction
743
-  (0.1ms) begin transaction
599
+  (0.5ms) rollback transaction
600
+  (0.0ms) begin transaction
744
601
   (0.0ms) SAVEPOINT active_record_1
745
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
746
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.258207"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.258207"]]
602
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
603
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.882712"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423857684], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:01:24.882712"]]
604
+  (0.0ms) RELEASE SAVEPOINT active_record_1
605
+  (0.3ms) rollback transaction
606
+  (0.0ms) begin transaction
607
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
608
+  (0.0ms) SAVEPOINT active_record_1
609
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-02-12 20:01:24.887200"], ["uid", 0], ["updated_at", "2015-02-12 20:01:24.887200"]]
747
610
   (0.0ms) RELEASE SAVEPOINT active_record_1
611
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
612
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
613
+  (0.3ms) rollback transaction
614
+  (0.0ms) begin transaction
615
+  (0.0ms) rollback transaction
616
+  (0.0ms) begin transaction
748
617
   (0.0ms) SAVEPOINT active_record_1
749
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
750
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.259464"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.259464"]]
618
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
619
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:24.900178"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-02-12 20:01:24.900178"]]
751
620
   (0.0ms) RELEASE SAVEPOINT active_record_1
752
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
621
+  (0.0ms) SAVEPOINT active_record_1
622
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
623
+ SQL (0.2ms) 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-02-12 20:01:24.901135"]]
624
+  (0.0ms) RELEASE SAVEPOINT active_record_1
625
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
626
+  (0.5ms) rollback transaction
627
+  (0.2ms) begin transaction
753
628
   (0.0ms) SAVEPOINT active_record_1
754
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
755
- 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", "2014-11-21 18:54:55.261738"]]
629
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
630
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:31.125780"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423857691], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:01:31.125780"]]
756
631
   (0.0ms) RELEASE SAVEPOINT active_record_1
757
-  (0.9ms) rollback transaction
758
-  (0.0ms) begin transaction
632
+  (0.5ms) rollback transaction
633
+  (0.2ms) begin transaction
759
634
   (0.0ms) SAVEPOINT active_record_1
760
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
761
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.265262"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.265262"]]
635
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
636
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:01:55.797523"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423857715], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:01:55.797523"]]
762
637
   (0.0ms) RELEASE SAVEPOINT active_record_1
638
+  (0.4ms) rollback transaction
639
+  (0.2ms) begin transaction
763
640
   (0.0ms) SAVEPOINT active_record_1
764
641
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
765
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.266712"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.266712"]]
642
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:06:16.319287"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685176], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:06:16.319287"]]
766
643
   (0.0ms) RELEASE SAVEPOINT active_record_1
767
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
768
-  (0.0ms) SAVEPOINT active_record_1
769
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
770
- 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", "2014-11-21 18:54:55.268755"]]
771
-  (0.0ms) RELEASE SAVEPOINT active_record_1
772
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
773
-  (0.9ms) rollback transaction
644
+  (0.4ms) rollback transaction
645
+  (0.0ms) begin transaction
646
+  (0.0ms) rollback transaction
774
647
   (0.0ms) begin transaction
775
648
   (0.0ms) SAVEPOINT active_record_1
776
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
777
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.271870"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:54:55.271870"]]
649
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
650
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:06:16.322197"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423857976], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:06:16.322197"]]
778
651
   (0.0ms) RELEASE SAVEPOINT active_record_1
652
+  (0.3ms) rollback transaction
653
+  (0.2ms) begin transaction
779
654
   (0.0ms) SAVEPOINT active_record_1
780
655
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
781
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.273459"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:54:55.273459"]]
656
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:09.770187"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858029], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:09.770187"]]
782
657
   (0.0ms) RELEASE SAVEPOINT active_record_1
783
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
784
-  (0.0ms) SAVEPOINT active_record_1
785
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
786
- 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", "2014-11-21 18:54:55.275506"]]
787
-  (0.0ms) RELEASE SAVEPOINT active_record_1
788
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
789
-  (0.7ms) rollback transaction
790
-  (0.1ms) begin transaction
791
-  (0.1ms) rollback transaction
658
+  (0.5ms) rollback transaction
792
659
   (0.0ms) begin transaction
793
660
   (0.0ms) rollback transaction
794
-  (0.1ms) begin transaction
661
+  (0.0ms) begin transaction
795
662
   (0.0ms) SAVEPOINT active_record_1
796
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
797
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:54:55.293348"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2014-11-21 18:54:55.293348"]]
798
-  (0.1ms) RELEASE SAVEPOINT active_record_1
663
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
664
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:09.777507"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685229], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:09.777507"]]
665
+  (0.0ms) RELEASE SAVEPOINT active_record_1
666
+  (0.3ms) rollback transaction
667
+  (0.2ms) begin transaction
799
668
   (0.0ms) SAVEPOINT active_record_1
800
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
801
- SQL (0.4ms) 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", "2014-11-21 18:54:55.295497"]]
669
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
670
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:19.000194"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685238], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:19.000194"]]
802
671
   (0.0ms) RELEASE SAVEPOINT active_record_1
803
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
804
-  (0.9ms) rollback transaction
805
-  (0.3ms) begin transaction
806
- Processing by AuthenticatedController#index as JS
807
- Rendered text template (0.1ms)
808
- Filter chain halted as :authenticate_account! rendered or redirected
809
- Completed 401 Unauthorized in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms)
810
-  (0.1ms) rollback transaction
811
-  (0.1ms) begin transaction
812
- Processing by AuthenticatedController#index as JS
813
- Filter chain halted as :authenticate_account! rendered or redirected
814
- Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
815
-  (0.0ms) rollback transaction
816
-  (0.1ms) begin transaction
817
- Processing by AuthenticatedController#index as HTML
818
- Redirected to http://test.host/auth/bookingsync/?account_id=
819
- Filter chain halted as :authenticate_account! rendered or redirected
820
- Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
821
-  (0.1ms) rollback transaction
672
+  (0.5ms) rollback transaction
822
673
   (0.0ms) begin transaction
823
- Processing by AuthenticatedController#index as HTML
824
- Filter chain halted as :authenticate_account! rendered or redirected
825
- Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
826
-  (0.0ms) rollback transaction
827
-  (0.1ms) begin transaction
828
- Processing by SessionsController#create as HTML
829
- Parameters: {"provider"=>"bookingsync"}
830
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
831
-  (0.1ms) SAVEPOINT active_record_1
832
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
833
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.301837"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.301837"]]
834
-  (0.0ms) RELEASE SAVEPOINT active_record_1
835
- Redirected to http://test.host/
836
- Completed 302 Found in 25ms (ActiveRecord: 2.0ms)
837
-  (0.7ms) rollback transaction
838
-  (0.1ms) begin transaction
839
- Processing by SessionsController#create as HTML
840
- Parameters: {"provider"=>"bookingsync"}
841
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
842
674
   (0.0ms) SAVEPOINT active_record_1
843
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
844
- 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", "2014-11-21 18:55:33.308496"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.308496"]]
845
-  (0.1ms) RELEASE SAVEPOINT active_record_1
846
- Redirected to http://test.host/
847
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
848
-  (0.5ms) rollback transaction
849
-  (0.1ms) begin transaction
850
- Processing by SessionsController#create as HTML
851
- Parameters: {"provider"=>"bookingsync"}
852
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
853
-  (0.0ms) SAVEPOINT active_record_1
854
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
855
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.313593"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.313593"]]
856
-  (0.0ms) RELEASE SAVEPOINT active_record_1
857
- Redirected to http://test.host/admin
858
- Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
859
-  (0.5ms) rollback transaction
860
-  (0.0ms) begin transaction
861
- Processing by SessionsController#destroy as HTML
862
- Redirected to http://test.host/signed_out
863
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
864
-  (0.0ms) rollback transaction
865
-  (0.0ms) begin transaction
866
- Processing by SessionsController#destroy as HTML
867
- Redirected to http://test.host/
868
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
869
-  (0.0ms) rollback transaction
870
-  (0.0ms) begin transaction
871
- Processing by SessionsController#failure as HTML
872
- Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
873
-  (0.1ms) rollback transaction
874
-  (0.1ms) begin transaction
875
- Processing by SessionsController#failure as HTML
876
- Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
877
-  (0.0ms) rollback transaction
878
-  (0.0ms) begin transaction
879
-  (0.0ms) SAVEPOINT active_record_1
880
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
881
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.329817"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.329817"]]
882
-  (0.0ms) RELEASE SAVEPOINT active_record_1
883
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
884
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
885
-  (0.0ms) SAVEPOINT active_record_1
886
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
887
- 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", "2014-11-21 18:55:33.334203"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.334203"]]
888
-  (0.0ms) RELEASE SAVEPOINT active_record_1
889
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
890
-  (0.9ms) rollback transaction
675
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
676
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:19.002839"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685239], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:19.002839"]]
677
+  (0.0ms) RELEASE SAVEPOINT active_record_1
678
+  (0.3ms) rollback transaction
891
679
   (0.0ms) begin transaction
892
680
   (0.0ms) SAVEPOINT active_record_1
893
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
894
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.338518"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.338518"]]
681
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
682
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:19.004445"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858039], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:19.004445"]]
895
683
   (0.0ms) RELEASE SAVEPOINT active_record_1
896
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
897
-  (0.0ms) SAVEPOINT active_record_1
898
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
899
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.340714"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.340714"]]
900
-  (0.0ms) RELEASE SAVEPOINT active_record_1
901
-  (0.8ms) rollback transaction
902
-  (0.1ms) begin transaction
903
-  (0.0ms) SAVEPOINT active_record_1
904
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
905
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.344157"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.344157"]]
906
-  (0.0ms) RELEASE SAVEPOINT active_record_1
907
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
684
+  (0.3ms) rollback transaction
685
+  (0.2ms) begin transaction
908
686
   (0.0ms) SAVEPOINT active_record_1
909
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
910
- 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", "2014-11-21 18:55:33.345820"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.345820"]]
687
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
688
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:45.038363"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858065], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:45.038363"]]
911
689
   (0.0ms) RELEASE SAVEPOINT active_record_1
912
-  (0.8ms) rollback transaction
690
+  (0.4ms) rollback transaction
913
691
   (0.0ms) begin transaction
914
692
   (0.0ms) SAVEPOINT active_record_1
915
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
916
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.348623"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.348623"]]
693
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
694
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:45.045485"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685265], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:45.045485"]]
917
695
   (0.0ms) RELEASE SAVEPOINT active_record_1
918
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
919
-  (0.0ms) SAVEPOINT active_record_1
920
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
921
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.350441"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.350441"]]
922
-  (0.0ms) RELEASE SAVEPOINT active_record_1
923
-  (0.6ms) rollback transaction
924
-  (0.1ms) begin transaction
925
-  (0.0ms) SAVEPOINT active_record_1
926
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
927
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.354184"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.354184"]]
928
-  (0.0ms) RELEASE SAVEPOINT active_record_1
929
-  (0.1ms) SAVEPOINT active_record_1
930
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
931
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.356113"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.356113"]]
932
-  (0.0ms) RELEASE SAVEPOINT active_record_1
933
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
696
+  (0.3ms) rollback transaction
697
+  (0.0ms) begin transaction
934
698
   (0.0ms) SAVEPOINT active_record_1
935
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
936
- 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", "2014-11-21 18:55:33.359201"]]
699
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
700
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:45.047345"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685265], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:45.047345"]]
937
701
   (0.0ms) RELEASE SAVEPOINT active_record_1
938
-  (1.0ms) rollback transaction
939
-  (0.1ms) begin transaction
702
+  (0.3ms) rollback transaction
703
+  (0.2ms) begin transaction
940
704
   (0.0ms) SAVEPOINT active_record_1
941
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
942
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.363296"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.363296"]]
705
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
706
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:51.526990"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858071], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:51.526990"]]
943
707
   (0.0ms) RELEASE SAVEPOINT active_record_1
708
+  (0.5ms) rollback transaction
709
+  (0.0ms) begin transaction
944
710
   (0.0ms) SAVEPOINT active_record_1
945
711
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
946
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.364644"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.364644"]]
712
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:51.533708"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685271], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:51.533708"]]
947
713
   (0.0ms) RELEASE SAVEPOINT active_record_1
948
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
949
-  (0.0ms) SAVEPOINT active_record_1
950
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
951
- 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", "2014-11-21 18:55:33.366259"]]
952
-  (0.0ms) RELEASE SAVEPOINT active_record_1
953
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
954
-  (0.9ms) rollback transaction
955
-  (0.1ms) begin transaction
956
-  (0.1ms) SAVEPOINT active_record_1
957
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
958
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.369941"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:55:33.369941"]]
714
+  (0.0ms) SAVEPOINT active_record_1
715
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
716
+ 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", 1423944471], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:07:51.534846"]]
959
717
   (0.0ms) RELEASE SAVEPOINT active_record_1
718
+  (0.5ms) rollback transaction
719
+  (0.0ms) begin transaction
960
720
   (0.0ms) SAVEPOINT active_record_1
961
721
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
962
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.371261"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:55:33.371261"]]
722
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:51.537102"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685271], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:51.537102"]]
963
723
   (0.0ms) RELEASE SAVEPOINT active_record_1
964
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
965
-  (0.0ms) SAVEPOINT active_record_1
966
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
967
- 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", "2014-11-21 18:55:33.372920"]]
968
-  (0.0ms) RELEASE SAVEPOINT active_record_1
969
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
970
-  (0.6ms) rollback transaction
971
-  (0.1ms) begin transaction
972
-  (0.1ms) rollback transaction
724
+  (0.0ms) SAVEPOINT active_record_1
725
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
726
+ 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", 1423944471], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:07:51.538004"]]
727
+  (0.0ms) RELEASE SAVEPOINT active_record_1
728
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
729
+  (0.6ms) rollback transaction
730
+  (0.2ms) begin transaction
731
+  (0.0ms) SAVEPOINT active_record_1
732
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
733
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:59.469958"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858079], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:59.469958"]]
734
+  (0.0ms) RELEASE SAVEPOINT active_record_1
735
+  (0.4ms) rollback transaction
973
736
   (0.0ms) begin transaction
974
-  (0.0ms) rollback transaction
737
+  (0.0ms) SAVEPOINT active_record_1
738
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
739
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:59.476828"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685279], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:59.476828"]]
740
+  (0.0ms) RELEASE SAVEPOINT active_record_1
741
+  (0.0ms) SAVEPOINT active_record_1
742
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
743
+ 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", 1423944479], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:07:59.478062"]]
744
+  (0.0ms) RELEASE SAVEPOINT active_record_1
745
+  (0.5ms) rollback transaction
975
746
   (0.0ms) begin transaction
976
747
   (0.0ms) SAVEPOINT active_record_1
977
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
978
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:55:33.381986"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2014-11-21 18:55:33.381986"]]
748
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
749
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:07:59.480168"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423685279], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:07:59.480168"]]
979
750
   (0.0ms) RELEASE SAVEPOINT active_record_1
980
751
   (0.0ms) SAVEPOINT active_record_1
981
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
982
- SQL (0.3ms) 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", "2014-11-21 18:55:33.383340"]]
752
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
753
+ 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", 1423944479], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:07:59.481277"]]
983
754
   (0.0ms) RELEASE SAVEPOINT active_record_1
984
755
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
985
-  (0.7ms) rollback transaction
986
-  (0.3ms) begin transaction
987
- Processing by AuthenticatedController#index as JS
988
- Rendered text template (0.0ms)
989
- Filter chain halted as :authenticate_account! rendered or redirected
990
- Completed 401 Unauthorized in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)
991
-  (0.1ms) rollback transaction
756
+  (0.6ms) rollback transaction
757
+  (0.2ms) begin transaction
758
+  (0.0ms) SAVEPOINT active_record_1
759
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
760
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:17.361778"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858097], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:17.361778"]]
761
+  (0.0ms) RELEASE SAVEPOINT active_record_1
762
+  (0.5ms) rollback transaction
992
763
   (0.0ms) begin transaction
993
- Processing by AuthenticatedController#index as JS
994
- Filter chain halted as :authenticate_account! rendered or redirected
995
- Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
996
-  (0.0ms) rollback transaction
764
+  (0.0ms) SAVEPOINT active_record_1
765
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
766
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:17.369132"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685297"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:17.369132"]]
767
+  (0.0ms) RELEASE SAVEPOINT active_record_1
768
+  (0.0ms) SAVEPOINT active_record_1
769
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
770
+ 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", "1423944497"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:08:17.370555"]]
771
+  (0.0ms) RELEASE SAVEPOINT active_record_1
772
+  (0.6ms) rollback transaction
997
773
   (0.0ms) begin transaction
998
- Processing by AuthenticatedController#index as HTML
999
- Redirected to http://test.host/auth/bookingsync/?account_id=
1000
- Filter chain halted as :authenticate_account! rendered or redirected
1001
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
1002
-  (0.0ms) rollback transaction
774
+  (0.0ms) SAVEPOINT active_record_1
775
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
776
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:17.373351"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685297"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:17.373351"]]
777
+  (0.0ms) RELEASE SAVEPOINT active_record_1
778
+  (0.0ms) SAVEPOINT active_record_1
779
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
780
+ 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", "1423944497"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:08:17.374422"]]
781
+  (0.0ms) RELEASE SAVEPOINT active_record_1
782
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
783
+  (0.4ms) rollback transaction
784
+  (0.2ms) begin transaction
785
+  (0.0ms) SAVEPOINT active_record_1
786
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
787
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:27.663084"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685307"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:27.663084"]]
788
+  (0.0ms) RELEASE SAVEPOINT active_record_1
789
+  (0.6ms) rollback transaction
1003
790
   (0.0ms) begin transaction
1004
- Processing by AuthenticatedController#index as HTML
1005
- Filter chain halted as :authenticate_account! rendered or redirected
1006
- Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1007
-  (0.0ms) rollback transaction
791
+  (0.0ms) SAVEPOINT active_record_1
792
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
793
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:27.765821"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685307"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:27.765821"]]
794
+  (0.0ms) RELEASE SAVEPOINT active_record_1
795
+  (0.4ms) rollback transaction
1008
796
   (0.0ms) begin transaction
1009
- Processing by SessionsController#create as HTML
1010
- Parameters: {"provider"=>"bookingsync"}
1011
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1012
-  (0.1ms) SAVEPOINT active_record_1
1013
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1014
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.646083"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.646083"]]
1015
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1016
- Redirected to http://test.host/
1017
- Completed 302 Found in 34ms (ActiveRecord: 2.0ms)
1018
-  (0.6ms) rollback transaction
1019
-  (0.0ms) begin transaction
1020
- Processing by SessionsController#create as HTML
1021
- Parameters: {"provider"=>"bookingsync"}
1022
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
797
+  (0.0ms) SAVEPOINT active_record_1
798
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
799
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:27.850237"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858107], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:27.850237"]]
800
+  (0.0ms) RELEASE SAVEPOINT active_record_1
801
+  (0.3ms) rollback transaction
802
+  (0.2ms) begin transaction
1023
803
   (0.0ms) SAVEPOINT active_record_1
1024
804
  Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1025
- 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", "2014-11-21 18:56:04.651985"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.651985"]]
805
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:39.768969"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685319"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:39.768969"]]
1026
806
   (0.0ms) RELEASE SAVEPOINT active_record_1
1027
- Redirected to http://test.host/
1028
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
1029
-  (0.5ms) rollback transaction
1030
-  (0.0ms) begin transaction
1031
- Processing by SessionsController#create as HTML
1032
- Parameters: {"provider"=>"bookingsync"}
1033
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
807
+  (0.0ms) SAVEPOINT active_record_1
808
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
809
+ 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", "1423944519"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:08:39.770439"]]
810
+  (0.0ms) RELEASE SAVEPOINT active_record_1
811
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
812
+  (0.7ms) rollback transaction
813
+  (0.0ms) begin transaction
1034
814
   (0.0ms) SAVEPOINT active_record_1
1035
815
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1036
- 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", "2014-11-21 18:56:04.657089"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.657089"]]
816
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:39.774408"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685319"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:39.774408"]]
817
+  (0.0ms) RELEASE SAVEPOINT active_record_1
818
+  (0.0ms) SAVEPOINT active_record_1
819
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
820
+ 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", "1423944519"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:08:39.775257"]]
1037
821
   (0.0ms) RELEASE SAVEPOINT active_record_1
1038
- Redirected to http://test.host/admin
1039
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
1040
822
   (0.5ms) rollback transaction
1041
-  (0.1ms) begin transaction
1042
- Processing by SessionsController#destroy as HTML
1043
- Redirected to http://test.host/signed_out
1044
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
1045
-  (0.0ms) rollback transaction
1046
823
   (0.0ms) begin transaction
1047
- Processing by SessionsController#destroy as HTML
1048
- Redirected to http://test.host/
1049
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
1050
-  (0.0ms) rollback transaction
824
+  (0.0ms) SAVEPOINT active_record_1
825
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
826
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:08:39.777040"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858119], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:08:39.777040"]]
827
+  (0.0ms) RELEASE SAVEPOINT active_record_1
828
+  (0.3ms) rollback transaction
829
+  (0.2ms) begin transaction
830
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
831
+  (0.1ms) SAVEPOINT active_record_1
832
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-02-12 20:19:46.419520"], ["uid", 0], ["updated_at", "2015-02-12 20:19:46.419520"]]
833
+  (0.0ms) RELEASE SAVEPOINT active_record_1
834
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
835
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
836
+  (0.5ms) rollback transaction
837
+  (0.0ms) begin transaction
838
+  (0.1ms) SAVEPOINT active_record_1
839
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
840
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.437620"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.437620"]]
841
+  (0.0ms) RELEASE SAVEPOINT active_record_1
842
+  (0.0ms) SAVEPOINT active_record_1
843
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
844
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.438633"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.438633"]]
845
+  (0.0ms) RELEASE SAVEPOINT active_record_1
846
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
847
+  (0.0ms) SAVEPOINT active_record_1
848
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
849
+ 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-02-12 20:19:46.443218"]]
850
+  (0.0ms) RELEASE SAVEPOINT active_record_1
851
+  (0.6ms) rollback transaction
1051
852
   (0.0ms) begin transaction
1052
- Processing by SessionsController#failure as HTML
1053
- Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
1054
-  (0.1ms) rollback transaction
1055
-  (0.1ms) begin transaction
1056
- Processing by SessionsController#failure as HTML
1057
- Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
1058
-  (0.1ms) rollback transaction
853
+  (0.0ms) SAVEPOINT active_record_1
854
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
855
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.446023"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.446023"]]
856
+  (0.0ms) RELEASE SAVEPOINT active_record_1
857
+  (0.0ms) SAVEPOINT active_record_1
858
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
859
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.446895"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.446895"]]
860
+  (0.0ms) RELEASE SAVEPOINT active_record_1
861
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
862
+  (0.0ms) SAVEPOINT active_record_1
863
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
864
+ 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-02-12 20:19:46.448155"]]
865
+  (0.0ms) RELEASE SAVEPOINT active_record_1
866
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
867
+  (0.5ms) rollback transaction
1059
868
   (0.0ms) begin transaction
1060
869
   (0.0ms) SAVEPOINT active_record_1
1061
870
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1062
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.673418"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.673418"]]
871
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.451130"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.451130"]]
1063
872
   (0.0ms) RELEASE SAVEPOINT active_record_1
1064
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
1065
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1066
873
   (0.0ms) SAVEPOINT active_record_1
1067
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1068
- SQL (1.1ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.677539"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.677539"]]
1069
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1070
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
1071
-  (0.7ms) rollback transaction
874
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
875
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.452140"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.452140"]]
876
+  (0.0ms) RELEASE SAVEPOINT active_record_1
877
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
878
+  (0.1ms) SAVEPOINT active_record_1
879
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
880
+ 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-02-12 20:19:46.453340"]]
881
+  (0.0ms) RELEASE SAVEPOINT active_record_1
882
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
883
+  (0.5ms) rollback transaction
884
+  (0.0ms) begin transaction
885
+  (0.1ms) SAVEPOINT active_record_1
886
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
887
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.455373"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.455373"]]
888
+  (0.0ms) RELEASE SAVEPOINT active_record_1
889
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
890
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
891
+  (0.0ms) SAVEPOINT active_record_1
892
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
893
+ 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-02-12 20:19:46.458622"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.458622"]]
894
+  (0.0ms) RELEASE SAVEPOINT active_record_1
895
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
896
+  (0.5ms) rollback transaction
1072
897
   (0.0ms) begin transaction
1073
898
   (0.0ms) SAVEPOINT active_record_1
1074
899
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1075
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.682020"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.682020"]]
900
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.460682"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.460682"]]
1076
901
   (0.0ms) RELEASE SAVEPOINT active_record_1
1077
902
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1078
-  (0.1ms) SAVEPOINT active_record_1
1079
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1080
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.684203"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.684203"]]
903
+  (0.0ms) SAVEPOINT active_record_1
904
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
905
+ 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-02-12 20:19:46.461899"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.461899"]]
1081
906
   (0.0ms) RELEASE SAVEPOINT active_record_1
1082
-  (1.0ms) rollback transaction
1083
-  (0.1ms) begin transaction
907
+  (0.5ms) rollback transaction
908
+  (0.0ms) begin transaction
1084
909
   (0.0ms) SAVEPOINT active_record_1
1085
910
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1086
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.688143"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.688143"]]
911
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.463834"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.463834"]]
1087
912
   (0.0ms) RELEASE SAVEPOINT active_record_1
1088
913
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1089
914
   (0.0ms) SAVEPOINT active_record_1
1090
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1091
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.689846"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.689846"]]
915
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
916
+ 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-02-12 20:19:46.464970"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.464970"]]
1092
917
   (0.0ms) RELEASE SAVEPOINT active_record_1
1093
-  (0.8ms) rollback transaction
1094
-  (0.1ms) begin transaction
918
+  (0.5ms) rollback transaction
919
+  (0.0ms) begin transaction
1095
920
   (0.0ms) SAVEPOINT active_record_1
1096
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1097
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.693559"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.693559"]]
921
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
922
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.467109"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:19:46.467109"]]
1098
923
   (0.0ms) RELEASE SAVEPOINT active_record_1
1099
924
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1100
925
   (0.0ms) SAVEPOINT active_record_1
926
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
927
+ 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-02-12 20:19:46.468395"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.468395"]]
928
+  (0.0ms) RELEASE SAVEPOINT active_record_1
929
+  (0.6ms) rollback transaction
930
+  (0.0ms) begin transaction
931
+  (0.0ms) SAVEPOINT active_record_1
1101
932
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1102
- SQL (0.5ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.695746"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.695746"]]
1103
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1104
-  (0.8ms) rollback transaction
933
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.471060"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858786], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.471060"]]
934
+  (0.0ms) RELEASE SAVEPOINT active_record_1
935
+  (0.3ms) rollback transaction
1105
936
   (0.0ms) begin transaction
937
+  (0.1ms) SAVEPOINT active_record_1
938
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
939
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.482655"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685986"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.482655"]]
940
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1106
941
   (0.0ms) SAVEPOINT active_record_1
1107
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1108
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.699896"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.699896"]]
1109
-  (0.1ms) RELEASE SAVEPOINT active_record_1
942
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
943
+ 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", "1423945186"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:19:46.483744"]]
944
+  (0.0ms) RELEASE SAVEPOINT active_record_1
945
+  (0.4ms) rollback transaction
946
+  (0.1ms) begin transaction
1110
947
   (0.0ms) SAVEPOINT active_record_1
1111
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1112
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.701117"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.701117"]]
948
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
949
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.485858"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423685986"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:19:46.485858"]]
1113
950
   (0.0ms) RELEASE SAVEPOINT active_record_1
1114
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
951
+  (0.0ms) SAVEPOINT active_record_1
952
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
953
+ 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", "1423945186"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:19:46.486830"]]
954
+  (0.0ms) RELEASE SAVEPOINT active_record_1
955
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
956
+  (0.5ms) rollback transaction
957
+  (0.0ms) begin transaction
1115
958
   (0.0ms) SAVEPOINT active_record_1
1116
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1117
- 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", "2014-11-21 18:56:04.703270"]]
959
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
960
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:19:46.489197"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-02-12 20:19:46.489197"]]
1118
961
   (0.0ms) RELEASE SAVEPOINT active_record_1
1119
-  (0.9ms) rollback transaction
1120
-  (0.1ms) begin transaction
1121
962
   (0.0ms) SAVEPOINT active_record_1
1122
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1123
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.706872"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.706872"]]
1124
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1125
-  (0.1ms) SAVEPOINT active_record_1
1126
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1127
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.708524"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.708524"]]
963
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
964
+ 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-02-12 20:19:46.489992"]]
1128
965
   (0.0ms) RELEASE SAVEPOINT active_record_1
1129
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1130
-  (0.1ms) SAVEPOINT active_record_1
1131
- Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1132
- 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", "2014-11-21 18:56:04.710545"]]
1133
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1134
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
1135
-  (0.9ms) rollback transaction
1136
-  (0.1ms) begin transaction
966
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
967
+  (0.5ms) rollback transaction
968
+  (0.1ms) begin transaction
969
+  (0.0ms) rollback transaction
970
+  (0.2ms) begin transaction
1137
971
   (0.0ms) SAVEPOINT active_record_1
1138
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1139
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.713706"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2014-11-21 18:56:04.713706"]]
972
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
973
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.417751"], ["oauth_access_token", "token"], ["oauth_expires_at", 1423858804], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.417751"]]
1140
974
   (0.0ms) RELEASE SAVEPOINT active_record_1
975
+  (0.4ms) rollback transaction
976
+  (0.0ms) begin transaction
1141
977
   (0.0ms) SAVEPOINT active_record_1
1142
978
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1143
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.714893"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2014-11-21 18:56:04.714893"]]
979
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.424927"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423686004"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.424927"]]
1144
980
   (0.0ms) RELEASE SAVEPOINT active_record_1
1145
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1146
-  (0.0ms) SAVEPOINT active_record_1
1147
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1148
- 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", "2014-11-21 18:56:04.716448"]]
1149
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1150
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
1151
-  (0.9ms) rollback transaction
1152
-  (0.1ms) begin transaction
1153
-  (0.1ms) rollback transaction
1154
-  (0.0ms) begin transaction
1155
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
1156
-  (0.1ms) SAVEPOINT active_record_1
1157
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-11-21 18:56:04.727373"], ["uid", 0], ["updated_at", "2014-11-21 18:56:04.727373"]]
981
+  (0.0ms) SAVEPOINT active_record_1
982
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
983
+ 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", "1423945204"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:20:04.426163"]]
1158
984
   (0.0ms) RELEASE SAVEPOINT active_record_1
1159
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
1160
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
1161
985
   (0.5ms) rollback transaction
1162
986
   (0.0ms) begin transaction
1163
987
   (0.0ms) SAVEPOINT active_record_1
1164
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
1165
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-21 18:56:04.739603"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2014-11-21 18:56:04.739603"]]
988
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
989
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.428553"], ["oauth_access_token", "token"], ["oauth_expires_at", "1423686004"], ["oauth_refresh_token", "refresh_token"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.428553"]]
1166
990
   (0.0ms) RELEASE SAVEPOINT active_record_1
1167
991
   (0.0ms) SAVEPOINT active_record_1
1168
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
1169
- SQL (0.3ms) 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", "2014-11-21 18:56:04.740929"]]
1170
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1171
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
1172
-  (0.9ms) rollback transaction
1173
-  (0.3ms) begin transaction
1174
-  (0.5ms) SAVEPOINT active_record_1
1175
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
1176
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.960480"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-01-14 18:40:39.960480"]]
992
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 1) LIMIT 1
993
+ 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", "1423945204"], ["oauth_refresh_token", "refreshed_refresh_token"], ["updated_at", "2015-02-12 20:20:04.429829"]]
1177
994
   (0.0ms) RELEASE SAVEPOINT active_record_1
1178
-  (0.0ms) SAVEPOINT active_record_1
1179
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
1180
- SQL (1.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-01-14 18:40:39.962784"]]
1181
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1182
995
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
1183
-  (0.7ms) rollback transaction
1184
-  (0.1ms) begin transaction
1185
-  (0.1ms) SAVEPOINT active_record_1
1186
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1187
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.970852"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:39.970852"]]
1188
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1189
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
1190
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1191
-  (0.0ms) SAVEPOINT active_record_1
1192
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1193
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.980606"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:39.980606"]]
1194
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1195
-  (0.1ms) SELECT COUNT(*) FROM "accounts"
1196
-  (0.8ms) rollback transaction
1197
-  (0.1ms) begin transaction
996
+  (0.6ms) rollback transaction
997
+  (0.0ms) begin transaction
998
+  (0.1ms) rollback transaction
999
+  (0.0ms) begin transaction
1000
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
1198
1001
   (0.0ms) SAVEPOINT active_record_1
1199
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1200
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.984743"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:39.984743"]]
1201
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1202
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1203
-  (0.1ms) SAVEPOINT active_record_1
1204
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1205
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.986955"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:39.986955"]]
1002
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-02-12 20:20:04.438271"], ["uid", 0], ["updated_at", "2015-02-12 20:20:04.438271"]]
1206
1003
   (0.0ms) RELEASE SAVEPOINT active_record_1
1207
-  (0.9ms) rollback transaction
1208
-  (0.1ms) begin transaction
1004
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
1005
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
1006
+  (0.4ms) rollback transaction
1007
+  (0.0ms) begin transaction
1209
1008
   (0.0ms) SAVEPOINT active_record_1
1210
1009
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1211
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.992046"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:39.992046"]]
1010
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.445127"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.445127"]]
1011
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1012
+  (0.0ms) SAVEPOINT active_record_1
1013
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1014
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.446040"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.446040"]]
1212
1015
   (0.0ms) RELEASE SAVEPOINT active_record_1
1213
1016
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1214
-  (0.1ms) SAVEPOINT active_record_1
1215
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1216
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.994291"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:39.994291"]]
1017
+  (0.0ms) SAVEPOINT active_record_1
1018
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1019
+ 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-02-12 20:20:04.449112"]]
1217
1020
   (0.0ms) RELEASE SAVEPOINT active_record_1
1218
-  (0.8ms) rollback transaction
1021
+  (0.6ms) rollback transaction
1219
1022
   (0.0ms) begin transaction
1220
1023
   (0.0ms) SAVEPOINT active_record_1
1221
1024
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1222
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:39.998610"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:39.998610"]]
1025
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.451438"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.451438"]]
1026
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1027
+  (0.0ms) SAVEPOINT active_record_1
1028
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1029
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.452311"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.452311"]]
1223
1030
   (0.0ms) RELEASE SAVEPOINT active_record_1
1224
1031
  Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1225
1032
   (0.0ms) SAVEPOINT active_record_1
1226
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1227
- 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-01-14 18:40:40.000362"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.000362"]]
1228
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1229
-  (0.7ms) rollback transaction
1230
-  (0.1ms) begin transaction
1231
-  (0.0ms) SAVEPOINT active_record_1
1232
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1233
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:40.003521"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:40.003521"]]
1033
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1034
+ 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-02-12 20:20:04.453458"]]
1234
1035
   (0.0ms) RELEASE SAVEPOINT active_record_1
1235
-  (0.0ms) SAVEPOINT active_record_1
1236
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1237
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:40.004954"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.004954"]]
1238
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1239
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1240
-  (0.1ms) SAVEPOINT active_record_1
1241
- Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1242
- 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-01-14 18:40:40.007787"]]
1243
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1244
-  (0.8ms) rollback transaction
1245
-  (0.1ms) begin transaction
1036
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
1037
+  (0.4ms) rollback transaction
1038
+  (0.0ms) begin transaction
1246
1039
   (0.0ms) SAVEPOINT active_record_1
1247
1040
  Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1248
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:40.011281"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:40.011281"]]
1041
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.455241"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.455241"]]
1249
1042
   (0.0ms) RELEASE SAVEPOINT active_record_1
1250
1043
   (0.0ms) SAVEPOINT active_record_1
1251
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1252
- SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:40.012643"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.012643"]]
1044
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1045
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.456063"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.456063"]]
1253
1046
   (0.0ms) RELEASE SAVEPOINT active_record_1
1254
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1047
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1255
1048
   (0.0ms) SAVEPOINT active_record_1
1256
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1257
- 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-01-14 18:40:40.014259"]]
1049
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1050
+ 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-02-12 20:20:04.457138"]]
1258
1051
   (0.0ms) RELEASE SAVEPOINT active_record_1
1259
1052
  Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
1260
-  (1.1ms) rollback transaction
1261
-  (0.1ms) begin transaction
1262
-  (0.1ms) SAVEPOINT active_record_1
1263
- Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1264
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:40.018999"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-01-14 18:40:40.018999"]]
1265
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1266
-  (0.1ms) SAVEPOINT active_record_1
1267
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1268
- SQL (0.4ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-01-14 18:40:40.021478"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.021478"]]
1269
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1270
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1271
-  (0.0ms) SAVEPOINT active_record_1
1272
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" = 123 AND "accounts"."id" != 2) LIMIT 1
1273
- 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-01-14 18:40:40.024435"]]
1274
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1275
- Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 2]]
1276
-  (1.0ms) rollback transaction
1277
-  (0.1ms) begin transaction
1278
-  (0.1ms) rollback transaction
1053
+  (0.5ms) rollback transaction
1279
1054
   (0.0ms) begin transaction
1280
- Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
1055
+  (0.0ms) SAVEPOINT active_record_1
1056
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1057
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.459060"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.459060"]]
1058
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1059
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
1060
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1061
+  (0.0ms) SAVEPOINT active_record_1
1062
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1063
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.461841"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.461841"]]
1064
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1065
+  (0.0ms) SELECT COUNT(*) FROM "accounts"
1066
+  (0.6ms) rollback transaction
1067
+  (0.0ms) begin transaction
1281
1068
   (0.0ms) SAVEPOINT active_record_1
1282
- SQL (0.3ms) INSERT INTO "accounts" ("created_at", "uid", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-01-14 18:40:40.047593"], ["uid", 0], ["updated_at", "2015-01-14 18:40:40.047593"]]
1069
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1070
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.464529"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.464529"]]
1071
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1072
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1073
+  (0.0ms) SAVEPOINT active_record_1
1074
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1075
+ 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-02-12 20:20:04.465642"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.465642"]]
1283
1076
   (0.0ms) RELEASE SAVEPOINT active_record_1
1284
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
1285
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 0 LIMIT 1
1286
-  (0.5ms) rollback transaction
1287
-  (0.1ms) begin transaction
1288
- Processing by SessionsController#failure as HTML
1289
- Rendered /Users/wijet/projects/bs/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
1290
- Completed 200 OK in 9ms (Views: 8.3ms | ActiveRecord: 0.0ms)
1291
-  (0.1ms) rollback transaction
1292
-  (0.0ms) begin transaction
1293
- Processing by SessionsController#failure as HTML
1294
- Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
1295
-  (0.0ms) rollback transaction
1296
-  (0.0ms) begin transaction
1297
- Processing by SessionsController#destroy as HTML
1298
- Redirected to http://test.host/signed_out
1299
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
1300
-  (0.0ms) rollback transaction
1301
-  (0.1ms) begin transaction
1302
- Processing by SessionsController#destroy as HTML
1303
- Redirected to http://test.host/
1304
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
1305
-  (0.0ms) rollback transaction
1077
+  (0.4ms) rollback transaction
1306
1078
   (0.0ms) begin transaction
1307
- Processing by SessionsController#create as HTML
1308
- Parameters: {"provider"=>"bookingsync"}
1309
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1079
+  (0.0ms) SAVEPOINT active_record_1
1080
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1081
+ SQL (0.2ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.467827"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.467827"]]
1082
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1083
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1310
1084
   (0.0ms) SAVEPOINT active_record_1
1311
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1312
- 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-01-14 18:40:40.087393"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.087393"]]
1085
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1086
+ SQL (0.3ms) INSERT INTO "accounts" ("created_at", "name", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.469054"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.469054"]]
1313
1087
   (0.0ms) RELEASE SAVEPOINT active_record_1
1314
- Redirected to http://test.host/admin
1315
- Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
1316
1088
   (0.5ms) rollback transaction
1317
1089
   (0.0ms) begin transaction
1318
- Processing by SessionsController#create as HTML
1319
- Parameters: {"provider"=>"bookingsync"}
1320
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1321
-  (0.0ms) SAVEPOINT active_record_1
1322
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1323
- 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-01-14 18:40:40.092446"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.092446"]]
1324
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1325
- Redirected to http://test.host/
1326
- Completed 302 Found in 2ms (ActiveRecord: 0.5ms)
1327
-  (0.7ms) rollback transaction
1328
-  (0.1ms) begin transaction
1329
- Processing by SessionsController#create as HTML
1330
- Parameters: {"provider"=>"bookingsync"}
1331
- Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1332
1090
   (0.0ms) SAVEPOINT active_record_1
1333
- Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1334
- 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-01-14 18:40:40.100455"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-01-14 18:40:40.100455"]]
1091
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 456 LIMIT 1
1092
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.471189"], ["provider", "bookingsync"], ["uid", 456], ["updated_at", "2015-02-12 20:20:04.471189"]]
1335
1093
   (0.0ms) RELEASE SAVEPOINT active_record_1
1336
- Redirected to http://test.host/
1337
- Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
1338
-  (0.7ms) rollback transaction
1339
-  (0.1ms) begin transaction
1340
-  (0.1ms) rollback transaction
1341
-  (0.1ms) begin transaction
1342
-  (0.1ms) rollback transaction
1343
-  (0.0ms) begin transaction
1344
-  (0.1ms) rollback transaction
1345
-  (0.0ms) begin transaction
1346
-  (0.1ms) rollback transaction
1347
-  (0.0ms) begin transaction
1348
- Processing by AuthenticatedController#index as JS
1349
- Filter chain halted as :authenticate_account! rendered or redirected
1350
- Completed 401 Unauthorized in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
1351
-  (0.1ms) rollback transaction
1352
-  (0.1ms) begin transaction
1353
- Processing by AuthenticatedController#index as JS
1354
- Filter chain halted as :authenticate_account! rendered or redirected
1355
- Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1356
-  (0.1ms) rollback transaction
1357
-  (0.1ms) begin transaction
1358
- Processing by AuthenticatedController#index as HTML
1359
- Redirected to http://test.host/auth/bookingsync/?account_id=
1360
- Filter chain halted as :authenticate_account! rendered or redirected
1361
- Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
1362
-  (0.1ms) rollback transaction
1363
-  (0.1ms) begin transaction
1364
- Processing by AuthenticatedController#index as HTML
1365
- Filter chain halted as :authenticate_account! rendered or redirected
1366
- Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1367
-  (0.1ms) rollback transaction
1094
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uid" = 123 AND "accounts"."provider" = 'bookingsync' LIMIT 1
1095
+  (0.0ms) SAVEPOINT active_record_1
1096
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" = 123 LIMIT 1
1097
+ 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-02-12 20:20:04.472297"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires at"], ["oauth_refresh_token", "refresh token"], ["provider", "bookingsync"], ["uid", 123], ["updated_at", "2015-02-12 20:20:04.472297"]]
1098
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1099
+  (0.5ms) rollback transaction
1100
+  (0.0ms) begin transaction
1101
+  (0.0ms) SAVEPOINT active_record_1
1102
+ Account Exists (0.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."uid" IS NULL LIMIT 1
1103
+ SQL (0.1ms) INSERT INTO "accounts" ("created_at", "oauth_access_token", "oauth_expires_at", "oauth_refresh_token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-02-12 20:20:04.474344"], ["oauth_access_token", "token"], ["oauth_expires_at", "expires"], ["oauth_refresh_token", "refresh"], ["updated_at", "2015-02-12 20:20:04.474344"]]
1104
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1105
+  (0.0ms) SAVEPOINT active_record_1
1106
+ Account Exists (0.0ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."uid" IS NULL AND "accounts"."id" != 1) LIMIT 1
1107
+ SQL (0.2ms) 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-02-12 20:20:04.475155"]]
1108
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1109
+ Account Load (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = ? LIMIT 1 [["id", 1]]
1110
+  (0.6ms) rollback transaction