user_impersonate2 0.9.2 → 0.10.0

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: 79dcaa58e0af34be4bda2e70631b6da1c207b25a
4
- data.tar.gz: fac240114eca6e3bc5003fbcd42cb322443cfb2c
3
+ metadata.gz: 41f59533772641d18710a8590c923455b2ba8fd7
4
+ data.tar.gz: e9f1bf130006f276fd3f63ea05ecdde95831c227
5
5
  SHA512:
6
- metadata.gz: 4747a157aec5dd7347766f854afa9279271b49e0144570831dd1957ae878214efda5b161b962fdeac904aac7a82851103983781a38e5af3ab8278e773a22eaeb
7
- data.tar.gz: 4da5517ac92079d073cc6d7c41361b4b67f7a8a8415acd76da746acec104b6179676289f64682cc5f6d7326c79d18a7e09c900a2dddb1f32fe165622a569fdc4
6
+ metadata.gz: 4be419909db112d9b44936d852e65ba7f5a9a84ed79b4840b0ddfb393fa156c2f9bdd4bdd86cb920c3d4264bb0bba786ab76b47855e7e03b7c1468e101090547
7
+ data.tar.gz: 52570611f69ad24203fa3cce786ec1712efebea4c797a41913c92385ba718a1af12303361c3774be949c5270f7d1ff3f9266bda30a212158a2d1c3f96173e419
data/README.md CHANGED
@@ -7,8 +7,8 @@
7
7
  ## Note
8
8
 
9
9
  This is a fork of Engine Yard's no-longer-maintained [`user_impersonate`](https://github.com/engineyard/user_impersonate)
10
- gem. It supports Rails 3.2.x and Rails 4 and has been tested against Ruby 1.9.3,
11
- 2.0.0 and 2.1.0.
10
+ gem and is its official successor. It supports Rails 3.2.x and Rails 4 and has
11
+ been tested against Ruby 1.9.3, 2.0.0 and 2.1.0.
12
12
 
13
13
  ## Overview
14
14
 
@@ -24,7 +24,8 @@ This Rails engine currently supports the following Rails authentication systems:
24
24
 
25
25
  ## Links
26
26
 
27
- * [Wiki](https://github.com/rcook/user_impersonate2/wiki) (includes tutorials etc.)
27
+ * [Wiki](https://github.com/rcook/user_impersonate2/wiki) (includes tutorials
28
+ etc.)
28
29
 
29
30
  ## Example usage
30
31
 
@@ -60,6 +61,8 @@ This adds the following line to your `config/routes.rb` file:
60
61
  mount UserImpersonate::Engine => "/impersonate", as: "impersonate_engine"
61
62
  ```
62
63
 
64
+ It also generates a default initializer under `config/initializers/user_impersonate2.rb`.
65
+
63
66
  Make sure that your layout files include the standard flashes since these are
64
67
  used to communicate information and error messages to the user:
65
68
 
@@ -170,8 +173,8 @@ created by the `user_impersonate` generator described above.
170
173
  # config/initializers/user_impersonate.rb
171
174
  module UserImpersonate
172
175
  class Engine < Rails::Engine
173
- config.redirect_on_impersonate = "/"
174
- config.redirect_on_revert = "/impersonate"
176
+ config.redirect_on_impersonate = '/'
177
+ config.redirect_on_revert = '/impersonate'
175
178
  end
176
179
  end
177
180
  ```
@@ -179,8 +182,9 @@ end
179
182
  ### User model and lookup
180
183
 
181
184
  By default, `user_impersonate2` assumes the user model is named `User`, that you
182
- use `User.find(id)` to find a user given its ID, and `aUser.id` to get the
183
- related ID value.
185
+ use `User.find(id)` to find a user given its ID, use `some_user.id` to get the
186
+ related ID value and that your user model has a `staff?` attribute that returns
187
+ `true` if the corresponding user is staff and `false` otherwise.
184
188
 
185
189
  You can change this default behaviour in the initializer `config/initializers/user_impersonate.rb`.
186
190
 
@@ -188,10 +192,35 @@ You can change this default behaviour in the initializer `config/initializers/us
188
192
  # config/initializers/user_impersonate.rb
189
193
  module UserImpersonate
190
194
  class Engine < Rails::Engine
191
- config.user_class = "User"
192
- config.user_finder = "find" # User.find
193
- config.user_id_column = "id" # Such that User.find(aUser.id) works
194
- config.user_is_staff_method = "staff?" # current_user.staff?
195
+ config.user_class = 'User'
196
+ config.user_finder = 'find'
197
+ config.user_id_column = 'id'
198
+ config.user_is_staff_method = 'staff?'
199
+ end
200
+ end
201
+ ```
202
+
203
+ By default, `user_impersonate2` will use the same model for staff/admin users
204
+ as that described above for regular users. Some configurations, using
205
+ frameworks such as [Active Admin](http://activeadmin.info/), for example, use a
206
+ different model for staff/admin users. `user_impersonate2`'s default behaviour
207
+ can be overridden using the following initializer settings:
208
+
209
+ ```ruby
210
+ # config/initializers/user_impersonate.rb
211
+ module UserImpersonate
212
+ class Engine < Rails::Engine
213
+ # For Active Admin "AdminUser" model, use 'authenticate_admin_user!'
214
+ config.authenticate_user_method = 'authenticate_admin_user!'
215
+
216
+ # For Active Admin "AdminUser" model, use 'AdminUser'
217
+ config.staff_class = 'AdminUser'
218
+
219
+ # Staff user model lookup method
220
+ config.staff_finder = 'find'
221
+
222
+ # For Active Admin "AdminUser" model, use 'current_admin_user'
223
+ config.current_staff = 'current_admin_user'
195
224
  end
196
225
  end
197
226
  ```
@@ -225,14 +254,14 @@ Use the following initializer:
225
254
  # config/initializers/user_impersonate.rb
226
255
  module UserImpersonate
227
256
  class Engine < Rails::Engine
228
- config.user_class = "Spree::User"
229
- config.user_finder = "find" # User.find
230
- config.user_id_column = "id" # Such that User.find(aUser.id) works
231
- config.user_is_staff_method = "staff?" # current_user.staff?
232
- config.authenticate_user_method = "authenticate_spree_user!"
233
- config.redirect_on_impersonate = "/"
234
- config.redirect_on_revert = "/"
235
- config.user_name_column = "users"
257
+ config.user_class = 'Spree::User'
258
+ config.user_finder = 'find'
259
+ config.user_id_column = 'id'
260
+ config.user_is_staff_method = 'staff?'
261
+ config.authenticate_user_method = 'authenticate_spree_user!'
262
+ config.redirect_on_impersonate = '/'
263
+ config.redirect_on_revert = '/'
264
+ config.user_name_column = 'users'
236
265
  end
237
266
  end
238
267
  ```
@@ -254,6 +283,31 @@ project. The minimum bar for all push requests is that the Travis-CI build must
254
283
  pass. Contributors are also strongly encouraged to add new tests to cover any
255
284
  new functionality introduced into the gem.
256
285
 
286
+ ### Installing gem dependencies via Bundler
287
+
288
+ To install all gem dependencies for the active version of Ruby and for a given
289
+ gemfile, you'll need to run the `bundle` command, e.g.
290
+
291
+ ```bash
292
+ BUNDLE_GEMFILE=Gemfile.rails3 bundle
293
+ ```
294
+
295
+ ### Running tests against all configurations (requires [rbenv](https://github.com/sstephenson/rbenv))
296
+
297
+ To run tests against all configurations specified in the Travis-CI configuration
298
+ file, run `script/test-all`:
299
+
300
+ ```bash
301
+ script/test-all
302
+ ```
303
+
304
+ This scripts requires that you have rbenv installed along with all required
305
+ versions of Ruby. Furthermore, you'll need to make sure that each version of
306
+ Ruby installed via rbenv has all the required gems available to it installed
307
+ using the `bundle` command.
308
+
309
+ ### Running tests against a single configuration
310
+
257
311
  To manually run the Travis-CI verification steps on your local machine, you can
258
312
  use the following sequence of commands for Rails 3.2.x:
259
313
 
@@ -267,6 +321,10 @@ To test against Rails 4.0.x, use:
267
321
  script/test -g Gemfile.rails4
268
322
  ```
269
323
 
324
+ `script/test` takes care of running Bundler to update any gem dependencies,
325
+ setting up the database, running all tests and then performing a test build of
326
+ the gem in order to catch any syntax errors.
327
+
270
328
  ## Licence
271
329
 
272
330
  `user_impersonate2` is released under the MIT licence.
@@ -15,7 +15,7 @@ module UserImpersonate
15
15
  @users = user_class.order("updated_at DESC").
16
16
  where(
17
17
  id_column.not_in [
18
- current_user.send(user_id_column.to_sym) # e.g. current_user.id
18
+ current_staff.send(user_id_column.to_sym) # e.g. current_user.id
19
19
  ])
20
20
  if params[:search]
21
21
  @users = @users.where("#{user_name_column} like ?", "%#{params[:search]}%")
@@ -37,7 +37,7 @@ module UserImpersonate
37
37
  flash[:notice] = "You weren't impersonating anyone"
38
38
  redirect_on_revert and return
39
39
  end
40
- user = current_user
40
+ user = current_staff
41
41
  revert_impersonate
42
42
  if user
43
43
  flash[:notice] = "No longer impersonating #{user}"
@@ -49,8 +49,15 @@ module UserImpersonate
49
49
  end
50
50
 
51
51
  private
52
+ def current_staff
53
+ @current_staff ||= begin
54
+ current_staff_method = config_or_default(:current_staff, "current_user").to_sym
55
+ send(current_staff_method) if respond_to? current_staff_method
56
+ end
57
+ end
58
+
52
59
  def current_user_must_be_staff!
53
- unless user_is_staff?(current_user)
60
+ unless user_is_staff?(current_staff)
54
61
  flash[:error] = "You don't have access to this section."
55
62
  redirect_to :back
56
63
  end
@@ -58,14 +65,14 @@ module UserImpersonate
58
65
  redirect_to '/'
59
66
  end
60
67
 
61
- # current_user changes from a staff user to
68
+ # current_staff changes from a staff user to
62
69
  # +new_user+; current user stored in +session[:staff_user_id]+
63
70
  def impersonate(new_user)
64
- session[:staff_user_id] = current_user.id #
71
+ session[:staff_user_id] = current_staff.id #
65
72
  sign_in_user new_user
66
73
  end
67
74
 
68
- # revert the +current_user+ back to the staff user
75
+ # revert the +current_staff+ back to the staff user
69
76
  # stored in +session[:staff_user_id]+
70
77
  def revert_impersonate
71
78
  return unless current_staff_user
@@ -91,8 +98,8 @@ module UserImpersonate
91
98
  # Similar to user.staff?
92
99
  # Using all the UserImpersonate config options
93
100
  def user_is_staff?(user)
94
- current_user.respond_to?(user_is_staff_method.to_sym) &&
95
- current_user.send(user_is_staff_method.to_sym)
101
+ current_staff.respond_to?(user_is_staff_method.to_sym) &&
102
+ current_staff.send(user_is_staff_method.to_sym)
96
103
  end
97
104
 
98
105
  def user_finder_method
@@ -2,10 +2,10 @@ module UserImpersonate
2
2
  module ApplicationHelper
3
3
  def current_staff_user
4
4
  return unless session[:staff_user_id]
5
- user_finder_method = (UserImpersonate::Engine.config.user_finder || "find").to_sym
6
- user_class_name = UserImpersonate::Engine.config.user_class || "User"
7
- user_class = user_class_name.constantize
8
- @staff_user ||= user_class.send(user_finder_method, session[:staff_user_id])
5
+ staff_finder_method = (UserImpersonate::Engine.config.staff_finder || "find").to_sym
6
+ staff_class_name = UserImpersonate::Engine.config.staff_class || "User"
7
+ staff_class = staff_class_name.constantize
8
+ @staff_user ||= staff_class.send(staff_finder_method, session[:staff_user_id])
9
9
  end
10
10
  end
11
11
  end
@@ -1,15 +1,44 @@
1
1
  module UserImpersonate
2
2
  class Engine < Rails::Engine
3
- config.user_class = "User"
4
- config.user_finder = "find" # User.find
5
- config.user_id_column = "id" # Such that User.find(aUser.id) works
6
- config.user_name_column = "name" # Such that User.where("#{user_name_column} like ?", "%#{params[:search]}%") works
7
- config.user_is_staff_method = "staff?" # current_user.staff?
3
+ # Devise user model
4
+ config.user_class = 'User'
8
5
 
9
- config.redirect_on_impersonate = "/"
10
- config.redirect_on_revert = "/impersonate"
6
+ # User model lookup method
7
+ config.user_finder = 'find'
11
8
 
12
- config.authenticate_user_method = "authenticate_user!" # protect impersonation controller
13
- config.sign_in_user_method = "sign_in" # sign_in(user)
9
+ # User model primary key attribute
10
+ config.user_id_column = 'id'
11
+
12
+ # User model name attribute used for search
13
+ # Usage: User.where('#{user_name_column} like ?', '%#{params[:search]}%')
14
+ config.user_name_column = 'name'
15
+
16
+ # User model staff attribute
17
+ config.user_is_staff_method = 'staff?'
18
+
19
+ # Redirect to this path when entering impersonate mode
20
+ config.redirect_on_impersonate = '/'
21
+
22
+ # Redirect to this path when leaving impersonate mode
23
+ config.redirect_on_revert = '/impersonate'
24
+
25
+ # Devise filter method used to protect impersonation controller
26
+ # For Active Admin "AdminUser" model, change to 'authenticate_admin_user!'
27
+ config.authenticate_user_method = 'authenticate_user!'
28
+
29
+ # Devise method used to sign user in
30
+ config.sign_in_user_method = 'sign_in'
31
+
32
+ # Devise staff user class
33
+ # For Active Admin "AdminUser" model, change to 'AdminUser'
34
+ config.staff_class = 'User'
35
+
36
+ # Staff user model lookup method
37
+ config.staff_finder = 'find'
38
+
39
+ # Devise method storing current user
40
+ # For Active Admin "AdminUser" model, change to 'current_admin_user'
41
+ config.current_staff = 'current_user'
14
42
  end
15
43
  end
44
+
@@ -5,7 +5,7 @@ module UserImpersonate
5
5
  # current_user changes from a staff user to
6
6
  # +new_user+; current user stored in +session[:staff_user_id]+
7
7
  def impersonate(new_user)
8
- session[:staff_user_id] = current_user.id #
8
+ session[:staff_user_id] = current_staff.id #
9
9
  sign_in new_user, bypass: true
10
10
  end
11
11
 
@@ -28,4 +28,4 @@ module UserImpersonate
28
28
  end
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -1,4 +1,4 @@
1
1
  module UserImpersonate
2
- VERSION = '0.9.2'
2
+ VERSION = '0.10.0'
3
3
  end
4
4
 
@@ -1,18 +1,45 @@
1
1
  module UserImpersonate
2
2
  class Engine < Rails::Engine
3
- config.user_class = "User"
4
- config.user_finder = "find" # User.find
5
- config.user_id_column = "id" # Such that User.find(aUser.id) works
6
- config.user_name_column = "name" # Such that User.where("#{user_name_column} like ?", "%#{params[:search]}%") works
7
- config.user_is_staff_method = "staff?" # current_user.staff?
3
+ # Devise user model
4
+ config.user_class = 'User'
8
5
 
9
- config.redirect_on_impersonate = "/"
6
+ # User model lookup method
7
+ config.user_finder = 'find'
10
8
 
11
- # Do not use the default /impersonate URL since this
12
- # does not render with impersonation header
13
- config.redirect_on_revert = "/"
9
+ # User model primary key attribute
10
+ config.user_id_column = 'id'
14
11
 
15
- config.authenticate_user_method = "authenticate_user!" # protect impersonation controller
16
- config.sign_in_user_method = "sign_in" # sign_in(user)
12
+ # User model name attribute used for search
13
+ # Usage: User.where('#{user_name_column} like ?', '%#{params[:search]}%')
14
+ config.user_name_column = 'name'
15
+
16
+ # User model staff attribute
17
+ config.user_is_staff_method = 'staff?'
18
+
19
+ # Redirect to this path when entering impersonate mode
20
+ config.redirect_on_impersonate = '/'
21
+
22
+ # Redirect to this path when leaving impersonate mode
23
+ # In test mode, we use '/' since this includes an impersonation header
24
+ config.redirect_on_revert = '/'
25
+
26
+ # Devise filter method used to protect impersonation controller
27
+ # For Active Admin "AdminUser" model, change to 'authenticate_admin_user!'
28
+ config.authenticate_user_method = 'authenticate_user!'
29
+
30
+ # Devise method used to sign user in
31
+ config.sign_in_user_method = 'sign_in'
32
+
33
+ # Devise staff user class
34
+ # For Active Admin "AdminUser" model, change to 'AdminUser'
35
+ config.staff_class = 'User'
36
+
37
+ # Staff user model lookup method
38
+ config.staff_finder = 'find'
39
+
40
+ # Devise method storing current user
41
+ # For Active Admin "AdminUser" model, change to 'current_admin_user'
42
+ config.current_staff = 'current_user'
17
43
  end
18
44
  end
45
+
@@ -260,3 +260,173 @@ Connecting to database specified by database.yml
260
260
   (0.3ms) SELECT version FROM "schema_migrations"
261
261
   (19.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
262
262
   (18.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
263
+ Connecting to database specified by database.yml
264
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
265
+  (0.2ms) select sqlite_version(*)
266
+  (22.4ms) DROP TABLE "users"
267
+  (27.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
268
+  (0.0ms) PRAGMA index_list("users")
269
+  (29.7ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
270
+  (0.0ms) PRAGMA index_list("users")
271
+  (0.1ms) PRAGMA index_info('index_users_on_email')
272
+  (15.6ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
273
+  (0.1ms) SELECT version FROM "schema_migrations"
274
+ Connecting to database specified by database.yml
275
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
276
+  (0.2ms) select sqlite_version(*)
277
+  (20.6ms) DROP TABLE "users"
278
+  (15.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
279
+  (0.0ms) PRAGMA index_list("users")
280
+  (20.2ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
281
+  (0.0ms) PRAGMA index_list("users")
282
+  (0.0ms) PRAGMA index_info('index_users_on_email')
283
+  (14.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
284
+  (0.0ms) SELECT version FROM "schema_migrations"
285
+ Connecting to database specified by database.yml
286
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
287
+  (0.2ms) select sqlite_version(*)
288
+  (32.9ms) DROP TABLE "users"
289
+  (23.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
290
+  (0.0ms) PRAGMA index_list("users")
291
+  (21.5ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
292
+  (0.0ms) PRAGMA index_list("users")
293
+  (0.0ms) PRAGMA index_info('index_users_on_email')
294
+  (25.9ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
295
+  (0.1ms) SELECT version FROM "schema_migrations"
296
+ Connecting to database specified by database.yml
297
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
298
+  (0.2ms) select sqlite_version(*)
299
+  (33.3ms) DROP TABLE "users"
300
+  (32.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
301
+  (0.0ms) PRAGMA index_list("users")
302
+  (24.5ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
303
+  (0.0ms) PRAGMA index_list("users")
304
+  (0.0ms) PRAGMA index_info('index_users_on_email')
305
+  (25.0ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
306
+  (0.1ms) SELECT version FROM "schema_migrations"
307
+ Connecting to database specified by database.yml
308
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
309
+  (0.2ms) select sqlite_version(*)
310
+  (15.7ms) DROP TABLE "users"
311
+  (25.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
312
+  (0.0ms) PRAGMA index_list("users")
313
+  (20.6ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
314
+  (0.1ms) PRAGMA index_list("users")
315
+  (0.0ms) PRAGMA index_info('index_users_on_email')
316
+  (24.7ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
317
+  (0.1ms) SELECT version FROM "schema_migrations"
318
+ Connecting to database specified by database.yml
319
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
320
+  (0.2ms) select sqlite_version(*)
321
+  (36.5ms) DROP TABLE "users"
322
+  (31.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
323
+  (0.0ms) PRAGMA index_list("users")
324
+  (15.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
325
+  (0.1ms) PRAGMA index_list("users")
326
+  (0.0ms) PRAGMA index_info('index_users_on_email')
327
+  (31.8ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
328
+  (0.1ms) SELECT version FROM "schema_migrations"
329
+ Connecting to database specified by database.yml
330
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
331
+  (0.2ms) select sqlite_version(*)
332
+  (21.7ms) DROP TABLE "users"
333
+  (15.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
334
+  (0.0ms) PRAGMA index_list("users")
335
+  (15.0ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
336
+  (0.1ms) PRAGMA index_list("users")
337
+  (0.0ms) PRAGMA index_info('index_users_on_email')
338
+  (15.0ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
339
+  (0.1ms) SELECT version FROM "schema_migrations"
340
+ Connecting to database specified by database.yml
341
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
342
+  (0.2ms) select sqlite_version(*)
343
+  (26.5ms) DROP TABLE "users"
344
+  (20.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
345
+  (0.0ms) PRAGMA index_list("users")
346
+  (30.9ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
347
+  (0.0ms) PRAGMA index_list("users")
348
+  (0.0ms) PRAGMA index_info('index_users_on_email')
349
+  (24.5ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
350
+  (0.1ms) SELECT version FROM "schema_migrations"
351
+ Connecting to database specified by database.yml
352
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
353
+  (0.2ms) select sqlite_version(*)
354
+  (34.3ms) DROP TABLE "users"
355
+  (21.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
356
+  (0.0ms) PRAGMA index_list("users")
357
+  (15.3ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
358
+  (0.0ms) PRAGMA index_list("users")
359
+  (0.0ms) PRAGMA index_info('index_users_on_email')
360
+  (22.5ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
361
+  (0.1ms) SELECT version FROM "schema_migrations"
362
+ Connecting to database specified by database.yml
363
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
364
+  (0.2ms) select sqlite_version(*)
365
+  (17.4ms) DROP TABLE "users"
366
+  (15.5ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
367
+  (0.0ms) PRAGMA index_list("users")
368
+  (35.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
369
+  (0.0ms) PRAGMA index_list("users")
370
+  (0.0ms) PRAGMA index_info('index_users_on_email')
371
+  (32.1ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
372
+  (0.3ms) SELECT version FROM "schema_migrations"
373
+ Connecting to database specified by database.yml
374
+  (1.1ms) select sqlite_version(*)
375
+  (36.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
376
+  (0.0ms) PRAGMA index_list("users")
377
+  (26.6ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
378
+  (0.1ms) PRAGMA index_list("users")
379
+  (0.0ms) PRAGMA index_info('index_users_on_email')
380
+  (32.8ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
381
+  (34.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
382
+  (0.0ms) PRAGMA index_list("schema_migrations")
383
+  (30.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
384
+  (0.1ms) SELECT version FROM "schema_migrations"
385
+  (32.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
386
+  (32.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
387
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
388
+ Connecting to database specified by database.yml
389
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
390
+  (0.1ms) select sqlite_version(*)
391
+  (31.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
392
+  (0.0ms) PRAGMA index_list("users")
393
+  (28.6ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
394
+  (0.1ms) PRAGMA index_list("users")
395
+  (0.0ms) PRAGMA index_info('index_users_on_email')
396
+  (24.8ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
397
+  (20.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
398
+  (0.0ms) PRAGMA index_list("schema_migrations")
399
+  (40.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
400
+  (0.1ms) SELECT version FROM "schema_migrations"
401
+  (37.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
402
+  (31.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
403
+ Connecting to database specified by database.yml
404
+  (0.6ms) select sqlite_version(*)
405
+  (16.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f')
406
+  (0.0ms) PRAGMA index_list("users")
407
+  (14.7ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
408
+  (0.1ms) PRAGMA index_list("users")
409
+  (0.0ms) PRAGMA index_info('index_users_on_email')
410
+  (34.5ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
411
+  (31.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
412
+  (0.0ms) PRAGMA index_list("schema_migrations")
413
+  (36.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
414
+  (0.0ms) SELECT version FROM "schema_migrations"
415
+  (32.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
416
+  (32.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')
417
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
418
+ Connecting to database specified by database.yml
419
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
420
+  (0.1ms) select sqlite_version(*)
421
+  (29.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "staff" boolean DEFAULT 'f') 
422
+  (0.0ms) PRAGMA index_list("users")
423
+  (22.4ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
424
+  (0.0ms) PRAGMA index_list("users")
425
+  (0.0ms) PRAGMA index_info('index_users_on_email')
426
+  (24.0ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
427
+  (24.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
428
+  (0.0ms) PRAGMA index_list("schema_migrations")
429
+  (24.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
430
+  (0.0ms) SELECT version FROM "schema_migrations"
431
+  (25.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914184123')
432
+  (23.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20120914174453')