token_field 0.0.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -81,6 +81,12 @@ then in view we call token_field with param :model => :category
81
81
  <%= f.token_field :parent_id, :model => :category, :token_url => token_categories_path %>
82
82
  <% end %>
83
83
 
84
+ in case model is in namespace for example MyApp you should use :model like this
85
+
86
+ <%= form_for @category do |f| %>
87
+ <%= f.token_field :parent_id, :model => "MyApp::Category", :token_url => token_categories_path %>
88
+ <% end %>
89
+
84
90
  if there would be model Parent, we can omit :model parameter.
85
91
  for example in Product model like this
86
92
 
@@ -1,3 +1,3 @@
1
1
  module TokenField
2
- VERSION = "0.0.3"
2
+ VERSION = "1.0.0"
3
3
  end
Binary file
@@ -8139,3 +8139,1383 @@ Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms)
8139
8139
   (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8140
8140
   (0.9ms) DELETE FROM "items";
8141
8141
   (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8142
+ Connecting to database specified by database.yml
8143
+  (0.1ms) begin transaction
8144
+ SQL (4.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:29 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:29 UTC +00:00]]
8145
+  (1.2ms) commit transaction
8146
+  (0.0ms) begin transaction
8147
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:29 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:29 UTC +00:00]]
8148
+  (1.0ms) commit transaction
8149
+  (0.0ms) begin transaction
8150
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:29 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:29 UTC +00:00]]
8151
+  (1.1ms) commit transaction
8152
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8153
+
8154
+
8155
+ Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:39:29 +0200
8156
+ Processing by CategoriesController#edit as HTML
8157
+ Parameters: {"id"=>"3"}
8158
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
8159
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8160
+ Rendered categories/_form.html.erb (9.0ms)
8161
+ Rendered categories/edit.html.erb within layouts/application (13.6ms)
8162
+ Completed 200 OK in 24ms (Views: 22.8ms | ActiveRecord: 0.4ms)
8163
+
8164
+
8165
+ Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:39:30 +0200
8166
+ Processing by CategoriesController#update as HTML
8167
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}
8168
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
8169
+  (0.1ms) begin transaction
8170
+  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:39:30.085163' WHERE "categories"."id" = 3
8171
+  (1.0ms) commit transaction
8172
+ Redirected to http://www.example.com/categories
8173
+ Completed 302 Found in 5ms (ActiveRecord: 1.4ms)
8174
+
8175
+
8176
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:30 +0200
8177
+ Processing by CategoriesController#index as HTML
8178
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" 
8179
+ Rendered categories/index.html.erb within layouts/application (1.9ms)
8180
+ Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms)
8181
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]
8182
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
8183
+  (1.0ms) DELETE FROM "categories";
8184
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
8185
+  (1.0ms) DELETE FROM "products";
8186
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
8187
+  (1.0ms) DELETE FROM "product_has_categories";
8188
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8189
+  (0.9ms) DELETE FROM "items";
8190
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8191
+  (0.1ms) begin transaction
8192
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00]]
8193
+  (1.0ms) commit transaction
8194
+
8195
+
8196
+ Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:39:30 +0200
8197
+ Processing by CategoriesController#new as HTML
8198
+ Rendered categories/_form.html.erb (2.5ms)
8199
+ Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)
8200
+
8201
+
8202
+ Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:39:30 +0200
8203
+ Processing by CategoriesController#create as HTML
8204
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}
8205
+  (0.1ms) begin transaction
8206
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00]]
8207
+  (1.1ms) commit transaction
8208
+ Redirected to http://www.example.com/categories
8209
+ Completed 302 Found in 4ms (ActiveRecord: 1.6ms)
8210
+
8211
+
8212
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:30 +0200
8213
+ Processing by CategoriesController#index as HTML
8214
+ Category Load (0.1ms) SELECT "categories".* FROM "categories"
8215
+ Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.1ms)
8216
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1
8217
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8218
+  (1.0ms) DELETE FROM "categories";
8219
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';
8220
+  (1.1ms) DELETE FROM "products";
8221
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
8222
+  (1.0ms) DELETE FROM "product_has_categories";
8223
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8224
+  (1.0ms) DELETE FROM "items";
8225
+  (1.7ms) DELETE FROM sqlite_sequence where name = 'items';
8226
+  (0.1ms) begin transaction
8227
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00]]
8228
+  (1.0ms) commit transaction
8229
+  (0.1ms) begin transaction
8230
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00]]
8231
+  (1.0ms) commit transaction
8232
+  (0.1ms) begin transaction
8233
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:30 UTC +00:00]]
8234
+  (1.1ms) commit transaction
8235
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8236
+
8237
+
8238
+ Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:39:32 +0200
8239
+ Processing by CategoriesController#edit as HTML
8240
+ Parameters: {"id"=>"3"}
8241
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
8242
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8243
+ Rendered categories/_form.html.erb (7.2ms)
8244
+ Completed 200 OK in 13ms (Views: 9.8ms | ActiveRecord: 1.1ms)
8245
+
8246
+
8247
+ Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 01:39:32 +0200
8248
+ Served asset /application.css - 200 OK (5ms)
8249
+
8250
+
8251
+ Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 01:39:32 +0200
8252
+ Served asset /application.js - 200 OK (6ms)
8253
+
8254
+
8255
+ Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-14 01:39:33 +0200
8256
+ Processing by CategoriesController#token as JSON
8257
+ Parameters: {"q"=>"new parent"}
8258
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%')
8259
+ Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms)
8260
+
8261
+
8262
+ Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:39:34 +0200
8263
+ Processing by CategoriesController#update as HTML
8264
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}
8265
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
8266
+  (0.1ms) begin transaction
8267
+  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:39:34.424859' WHERE "categories"."id" = 3
8268
+  (0.7ms) commit transaction
8269
+ Redirected to http://127.0.0.1:56775/categories
8270
+ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)
8271
+
8272
+
8273
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:34 +0200
8274
+ Processing by CategoriesController#index as HTML
8275
+ Category Load (0.2ms) SELECT "categories".* FROM "categories"
8276
+ Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms)
8277
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]
8278
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
8279
+  (1.3ms) DELETE FROM "categories";
8280
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
8281
+  (2.6ms) DELETE FROM "products";
8282
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';
8283
+  (1.5ms) DELETE FROM "product_has_categories";
8284
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8285
+  (1.5ms) DELETE FROM "items";
8286
+  (1.5ms) DELETE FROM sqlite_sequence where name = 'items';
8287
+  (0.1ms) begin transaction
8288
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:34 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:34 UTC +00:00]]
8289
+  (65.0ms) commit transaction
8290
+
8291
+
8292
+ Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:39:34 +0200
8293
+ Processing by CategoriesController#new as HTML
8294
+ Rendered categories/_form.html.erb (2.6ms)
8295
+ Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)
8296
+
8297
+
8298
+ Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-14 01:39:35 +0200
8299
+ Processing by CategoriesController#token as JSON
8300
+ Parameters: {"q"=>"wood"}
8301
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%')
8302
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
8303
+
8304
+
8305
+ Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8306
+ Processing by CategoriesController#create as HTML
8307
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}
8308
+  (0.1ms) begin transaction
8309
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8310
+  (0.9ms) commit transaction
8311
+ Redirected to http://127.0.0.1:56775/categories
8312
+ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)
8313
+
8314
+
8315
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8316
+ Processing by CategoriesController#index as HTML
8317
+ Category Load (0.1ms) SELECT "categories".* FROM "categories"
8318
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.1ms)
8319
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1
8320
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8321
+  (1.0ms) DELETE FROM "categories";
8322
+  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';
8323
+  (1.2ms) DELETE FROM "products";
8324
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
8325
+  (1.0ms) DELETE FROM "product_has_categories";
8326
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8327
+  (0.8ms) DELETE FROM "items";
8328
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8329
+  (0.1ms) begin transaction
8330
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8331
+  (0.8ms) commit transaction
8332
+
8333
+
8334
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8335
+ Processing by CategoriesController#index as HTML
8336
+ Category Load (0.2ms) SELECT "categories".* FROM "categories"
8337
+ Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)
8338
+  (1.0ms) DELETE FROM "categories";
8339
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
8340
+  (0.9ms) DELETE FROM "products";
8341
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
8342
+  (1.0ms) DELETE FROM "product_has_categories";
8343
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8344
+  (1.0ms) DELETE FROM "items";
8345
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8346
+  (0.1ms) begin transaction
8347
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8348
+  (1.8ms) commit transaction
8349
+  (0.1ms) begin transaction
8350
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8351
+  (0.8ms) commit transaction
8352
+  (0.1ms) begin transaction
8353
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8354
+  (0.7ms) commit transaction
8355
+  (0.1ms) begin transaction
8356
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8357
+  (0.9ms) commit transaction
8358
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8359
+
8360
+
8361
+ Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8362
+ Processing by ItemsController#edit as HTML
8363
+ Parameters: {"id"=>"1"}
8364
+ Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
8365
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8366
+ Rendered items/_form.html.erb (65.6ms)
8367
+ Completed 200 OK in 72ms (Views: 70.1ms | ActiveRecord: 0.4ms)
8368
+
8369
+
8370
+ Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8371
+ Processing by ItemsController#update as HTML
8372
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}
8373
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
8374
+  (0.0ms) begin transaction
8375
+  (0.2ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:39:36.338070' WHERE "items"."id" = 1
8376
+  (1.8ms) commit transaction
8377
+ Redirected to http://www.example.com/items
8378
+ Completed 302 Found in 5ms (ActiveRecord: 2.2ms)
8379
+
8380
+
8381
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8382
+ Processing by ItemsController#index as HTML
8383
+ Item Load (0.2ms) SELECT "items".* FROM "items"
8384
+ Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)
8385
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]
8386
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
8387
+  (1.1ms) DELETE FROM "categories";
8388
+  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';
8389
+  (0.9ms) DELETE FROM "products";
8390
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';
8391
+  (1.0ms) DELETE FROM "product_has_categories";
8392
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8393
+  (1.0ms) DELETE FROM "items";
8394
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
8395
+  (0.1ms) begin transaction
8396
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8397
+  (0.9ms) commit transaction
8398
+  (0.1ms) begin transaction
8399
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8400
+  (1.0ms) commit transaction
8401
+  (0.0ms) begin transaction
8402
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8403
+  (0.8ms) commit transaction
8404
+
8405
+
8406
+ Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8407
+ Processing by ItemsController#new as HTML
8408
+ Rendered items/_form.html.erb (3.7ms)
8409
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
8410
+
8411
+
8412
+ Started POST "/items" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8413
+ Processing by ItemsController#create as HTML
8414
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}
8415
+  (0.1ms) begin transaction
8416
+ SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8417
+  (1.8ms) commit transaction
8418
+ Redirected to http://www.example.com/items
8419
+ Completed 302 Found in 5ms (ActiveRecord: 2.5ms)
8420
+
8421
+
8422
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8423
+ Processing by ItemsController#index as HTML
8424
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
8425
+ Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms)
8426
+ Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1
8427
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8428
+  (1.0ms) DELETE FROM "categories";
8429
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
8430
+  (1.1ms) DELETE FROM "products";
8431
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
8432
+  (1.0ms) DELETE FROM "product_has_categories";
8433
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8434
+  (0.9ms) DELETE FROM "items";
8435
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
8436
+  (0.1ms) begin transaction
8437
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8438
+  (1.8ms) commit transaction
8439
+  (0.1ms) begin transaction
8440
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8441
+  (0.9ms) commit transaction
8442
+  (0.0ms) begin transaction
8443
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8444
+  (0.8ms) commit transaction
8445
+  (0.0ms) begin transaction
8446
+ SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 23:39:36 UTC +00:00]]
8447
+  (1.0ms) commit transaction
8448
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8449
+
8450
+
8451
+ Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:39:36 +0200
8452
+ Processing by ItemsController#edit as HTML
8453
+ Parameters: {"id"=>"1"}
8454
+ Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
8455
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8456
+ Rendered items/_form.html.erb (4.9ms)
8457
+ Completed 200 OK in 8ms (Views: 6.1ms | ActiveRecord: 0.5ms)
8458
+
8459
+
8460
+ Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:39:37 +0200
8461
+ Processing by CategoriesController#token as JSON
8462
+ Parameters: {"q"=>"skirt"}
8463
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%')
8464
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms)
8465
+
8466
+
8467
+ Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:39:37 +0200
8468
+ Processing by ItemsController#update as HTML
8469
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}
8470
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
8471
+  (0.0ms) begin transaction
8472
+  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:39:37.953972' WHERE "items"."id" = 1
8473
+  (1.0ms) commit transaction
8474
+ Redirected to http://127.0.0.1:56775/items
8475
+ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)
8476
+
8477
+
8478
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:37 +0200
8479
+ Processing by ItemsController#index as HTML
8480
+ Item Load (0.1ms) SELECT "items".* FROM "items"
8481
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms)
8482
+ Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]
8483
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
8484
+  (1.0ms) DELETE FROM "categories";
8485
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
8486
+  (0.9ms) DELETE FROM "products";
8487
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';
8488
+  (0.9ms) DELETE FROM "product_has_categories";
8489
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8490
+  (1.0ms) DELETE FROM "items";
8491
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';
8492
+  (0.1ms) begin transaction
8493
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:38 UTC +00:00]]
8494
+  (1.8ms) commit transaction
8495
+  (0.1ms) begin transaction
8496
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:38 UTC +00:00]]
8497
+  (0.9ms) commit transaction
8498
+  (0.1ms) begin transaction
8499
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:38 UTC +00:00]]
8500
+  (1.3ms) commit transaction
8501
+
8502
+
8503
+ Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:39:38 +0200
8504
+ Processing by ItemsController#new as HTML
8505
+ Rendered items/_form.html.erb (5.9ms)
8506
+ Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms)
8507
+
8508
+
8509
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:39:38 +0200
8510
+ Processing by CategoriesController#token as JSON
8511
+ Parameters: {"q"=>"shoes"}
8512
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
8513
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
8514
+
8515
+
8516
+ Started POST "/items" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8517
+ Processing by ItemsController#create as HTML
8518
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}
8519
+  (0.1ms) begin transaction
8520
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8521
+  (0.9ms) commit transaction
8522
+ Redirected to http://127.0.0.1:56775/items
8523
+ Completed 302 Found in 3ms (ActiveRecord: 1.5ms)
8524
+
8525
+
8526
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8527
+ Processing by ItemsController#index as HTML
8528
+ Item Load (0.1ms) SELECT "items".* FROM "items"
8529
+ Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms)
8530
+ Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1
8531
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8532
+  (1.4ms) DELETE FROM "categories";
8533
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
8534
+  (0.9ms) DELETE FROM "products";
8535
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';
8536
+  (1.2ms) DELETE FROM "product_has_categories";
8537
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8538
+  (1.1ms) DELETE FROM "items";
8539
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';
8540
+  (0.1ms) begin transaction
8541
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8542
+  (1.0ms) commit transaction
8543
+  (0.1ms) begin transaction
8544
+ SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8545
+  (1.1ms) commit transaction
8546
+  (0.1ms) begin transaction
8547
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8548
+  (0.8ms) commit transaction
8549
+  (0.1ms) begin transaction
8550
+ SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8551
+  (0.9ms) commit transaction
8552
+
8553
+
8554
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8555
+ Processing by ItemsController#index as HTML
8556
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
8557
+ Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms)
8558
+  (1.0ms) DELETE FROM "categories";
8559
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';
8560
+  (1.0ms) DELETE FROM "products";
8561
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
8562
+  (1.1ms) DELETE FROM "product_has_categories";
8563
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8564
+  (0.9ms) DELETE FROM "items";
8565
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
8566
+  (0.1ms) begin transaction
8567
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8568
+  (1.8ms) commit transaction
8569
+  (0.1ms) begin transaction
8570
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8571
+  (1.2ms) commit transaction
8572
+  (0.0ms) begin transaction
8573
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8574
+  (1.0ms) commit transaction
8575
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
8576
+  (0.0ms) begin transaction
8577
+ SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8578
+ SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8579
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8580
+  (1.6ms) commit transaction
8581
+
8582
+
8583
+ Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8584
+ Processing by ProductsController#edit as HTML
8585
+ Parameters: {"id"=>"1"}
8586
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
8587
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8588
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8589
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8590
+ Rendered products/_form.html.erb (15.8ms)
8591
+ Completed 200 OK in 20ms (Views: 18.4ms | ActiveRecord: 0.5ms)
8592
+
8593
+
8594
+ Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8595
+ Processing by ProductsController#update as HTML
8596
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"}
8597
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
8598
+  (0.0ms) begin transaction
8599
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1)
8600
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8601
+ SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3
8602
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8603
+  (1.6ms) commit transaction
8604
+ Redirected to http://www.example.com/products
8605
+ Completed 302 Found in 11ms (ActiveRecord: 2.5ms)
8606
+
8607
+
8608
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8609
+ Processing by ProductsController#index as HTML
8610
+ Product Load (0.2ms) SELECT "products".* FROM "products"
8611
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8612
+ Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.3ms)
8613
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]
8614
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8615
+  (1.3ms) DELETE FROM "categories";
8616
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
8617
+  (1.2ms) DELETE FROM "products";
8618
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';
8619
+  (1.1ms) DELETE FROM "product_has_categories";
8620
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8621
+  (0.9ms) DELETE FROM "items";
8622
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';
8623
+  (0.1ms) begin transaction
8624
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8625
+  (0.9ms) commit transaction
8626
+  (0.1ms) begin transaction
8627
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8628
+  (1.0ms) commit transaction
8629
+  (0.0ms) begin transaction
8630
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8631
+  (1.1ms) commit transaction
8632
+
8633
+
8634
+ Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8635
+ Processing by ProductsController#new as HTML
8636
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
8637
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
8638
+ Rendered products/_form.html.erb (4.3ms)
8639
+ Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.2ms)
8640
+
8641
+
8642
+ Started POST "/products" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8643
+ Processing by ProductsController#create as HTML
8644
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"}
8645
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)
8646
+  (0.0ms) begin transaction
8647
+ SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8648
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8649
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:39 UTC +00:00]]
8650
+  (1.2ms) commit transaction
8651
+ Redirected to http://www.example.com/products
8652
+ Completed 302 Found in 7ms (ActiveRecord: 2.1ms)
8653
+
8654
+
8655
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:39 +0200
8656
+ Processing by ProductsController#index as HTML
8657
+ Product Load (0.2ms) SELECT "products".* FROM "products" 
8658
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8659
+ Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms)
8660
+ Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1
8661
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8662
+  (0.9ms) DELETE FROM "categories";
8663
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
8664
+  (0.8ms) DELETE FROM "products";
8665
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';
8666
+  (1.0ms) DELETE FROM "product_has_categories";
8667
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8668
+  (0.9ms) DELETE FROM "items";
8669
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8670
+  (0.1ms) begin transaction
8671
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00]]
8672
+  (1.8ms) commit transaction
8673
+  (0.1ms) begin transaction
8674
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00]]
8675
+  (1.1ms) commit transaction
8676
+  (0.0ms) begin transaction
8677
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00]]
8678
+  (1.1ms) commit transaction
8679
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
8680
+  (0.0ms) begin transaction
8681
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00]]
8682
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00]]
8683
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:40 UTC +00:00]]
8684
+  (1.2ms) commit transaction
8685
+
8686
+
8687
+ Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:39:40 +0200
8688
+ Processing by ProductsController#edit as HTML
8689
+ Parameters: {"id"=>"1"}
8690
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
8691
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8692
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8693
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8694
+ Rendered products/_form.html.erb (6.0ms)
8695
+ Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.8ms)
8696
+
8697
+
8698
+ Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:39:40 +0200
8699
+ Processing by CategoriesController#token as JSON
8700
+ Parameters: {"q"=>"skirt"}
8701
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%')
8702
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
8703
+
8704
+
8705
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:39:41 +0200
8706
+ Processing by CategoriesController#token as JSON
8707
+ Parameters: {"q"=>"shoes"}
8708
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
8709
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)
8710
+
8711
+
8712
+ Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:39:42 +0200
8713
+ Processing by ProductsController#update as HTML
8714
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"}
8715
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
8716
+  (0.1ms) begin transaction
8717
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1)
8718
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8719
+ SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3
8720
+ SQL (0.6ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00]]
8721
+  (1.1ms) commit transaction
8722
+ Redirected to http://127.0.0.1:56775/products
8723
+ Completed 302 Found in 9ms (ActiveRecord: 2.4ms)
8724
+
8725
+
8726
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:42 +0200
8727
+ Processing by ProductsController#index as HTML
8728
+ Product Load (0.2ms) SELECT "products".* FROM "products" 
8729
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8730
+ Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.4ms)
8731
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]
8732
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8733
+  (0.9ms) DELETE FROM "categories";
8734
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
8735
+  (1.5ms) DELETE FROM "products";
8736
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';
8737
+  (1.4ms) DELETE FROM "product_has_categories";
8738
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8739
+  (1.0ms) DELETE FROM "items";
8740
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';
8741
+  (0.1ms) begin transaction
8742
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00]]
8743
+  (1.4ms) commit transaction
8744
+  (0.1ms) begin transaction
8745
+ SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00]]
8746
+  (0.9ms) commit transaction
8747
+  (0.1ms) begin transaction
8748
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:42 UTC +00:00]]
8749
+  (0.8ms) commit transaction
8750
+
8751
+
8752
+ Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:39:42 +0200
8753
+ Processing by ProductsController#new as HTML
8754
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
8755
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
8756
+ Rendered products/_form.html.erb (4.5ms)
8757
+ Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.3ms)
8758
+
8759
+
8760
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:39:43 +0200
8761
+ Processing by CategoriesController#token as JSON
8762
+ Parameters: {"q"=>"shoes"}
8763
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
8764
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms)
8765
+
8766
+
8767
+ Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-14 01:39:44 +0200
8768
+ Processing by CategoriesController#token as JSON
8769
+ Parameters: {"q"=>"pents"}
8770
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%')
8771
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms)
8772
+
8773
+
8774
+ Started POST "/products" for 127.0.0.1 at 2012-10-14 01:39:45 +0200
8775
+ Processing by ProductsController#create as HTML
8776
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"}
8777
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
8778
+  (0.1ms) begin transaction
8779
+ SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8780
+ SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8781
+ SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8782
+  (1.1ms) commit transaction
8783
+ Redirected to http://127.0.0.1:56775/products
8784
+ Completed 302 Found in 10ms (ActiveRecord: 2.7ms)
8785
+
8786
+
8787
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:45 +0200
8788
+ Processing by ProductsController#index as HTML
8789
+ Product Load (0.1ms) SELECT "products".* FROM "products"
8790
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8791
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms)
8792
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1
8793
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8794
+  (1.0ms) DELETE FROM "categories";
8795
+  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';
8796
+  (1.0ms) DELETE FROM "products";
8797
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';
8798
+  (1.0ms) DELETE FROM "product_has_categories";
8799
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8800
+  (0.9ms) DELETE FROM "items";
8801
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8802
+  (0.1ms) begin transaction
8803
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8804
+  (0.9ms) commit transaction
8805
+  (0.1ms) begin transaction
8806
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8807
+  (0.9ms) commit transaction
8808
+  (0.0ms) begin transaction
8809
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8810
+  (1.1ms) commit transaction
8811
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)
8812
+  (0.0ms) begin transaction
8813
+ SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8814
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8815
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:39:45 UTC +00:00]]
8816
+  (1.8ms) commit transaction
8817
+
8818
+
8819
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:45 +0200
8820
+ Processing by ProductsController#index as HTML
8821
+ Product Load (0.1ms) SELECT "products".* FROM "products" 
8822
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
8823
+ Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms)
8824
+  (1.0ms) DELETE FROM "categories";
8825
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
8826
+  (1.0ms) DELETE FROM "products";
8827
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';
8828
+  (0.9ms) DELETE FROM "product_has_categories";
8829
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8830
+  (1.0ms) DELETE FROM "items";
8831
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8832
+ Connecting to database specified by database.yml
8833
+  (0.1ms) begin transaction
8834
+ SQL (4.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:06 UTC +00:00]]
8835
+  (1.5ms) commit transaction
8836
+  (0.1ms) begin transaction
8837
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:06 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:06 UTC +00:00]]
8838
+  (1.1ms) commit transaction
8839
+  (0.1ms) begin transaction
8840
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:06 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:06 UTC +00:00]]
8841
+  (1.0ms) commit transaction
8842
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8843
+
8844
+
8845
+ Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:47:09 +0200
8846
+ Processing by CategoriesController#edit as HTML
8847
+ Parameters: {"id"=>"3"}
8848
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
8849
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8850
+ Rendered categories/_form.html.erb (10.6ms)
8851
+ Rendered categories/edit.html.erb within layouts/application (46.6ms)
8852
+ Completed 200 OK in 62ms (Views: 59.2ms | ActiveRecord: 0.9ms)
8853
+
8854
+
8855
+ Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 01:47:10 +0200
8856
+ Served asset /application.css - 200 OK (6ms)
8857
+
8858
+
8859
+ Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 01:47:10 +0200
8860
+ Served asset /application.js - 200 OK (6ms)
8861
+
8862
+
8863
+ Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-14 01:47:10 +0200
8864
+ Processing by CategoriesController#token as JSON
8865
+ Parameters: {"q"=>"new parent"}
8866
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%')
8867
+ Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms)
8868
+
8869
+
8870
+ Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:47:11 +0200
8871
+ Processing by CategoriesController#update as HTML
8872
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}
8873
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
8874
+  (0.1ms) begin transaction
8875
+  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:47:11.535973' WHERE "categories"."id" = 3
8876
+  (0.5ms) commit transaction
8877
+ Redirected to http://127.0.0.1:57074/categories
8878
+ Completed 302 Found in 7ms (ActiveRecord: 1.1ms)
8879
+
8880
+
8881
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200
8882
+ Processing by CategoriesController#index as HTML
8883
+ Category Load (0.2ms) SELECT "categories".* FROM "categories"
8884
+ Rendered categories/index.html.erb within layouts/application (2.3ms)
8885
+ Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.2ms)
8886
+ Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]
8887
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
8888
+  (55.5ms) DELETE FROM "categories";
8889
+  (2.3ms) DELETE FROM sqlite_sequence where name = 'categories';
8890
+  (1.1ms) DELETE FROM "products";
8891
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
8892
+  (0.9ms) DELETE FROM "product_has_categories";
8893
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8894
+  (1.8ms) DELETE FROM "items";
8895
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';
8896
+  (0.1ms) begin transaction
8897
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:11 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:11 UTC +00:00]]
8898
+  (1.1ms) commit transaction
8899
+
8900
+
8901
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200
8902
+ Processing by CategoriesController#index as HTML
8903
+ Category Load (0.1ms) SELECT "categories".* FROM "categories"
8904
+ Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.1ms)
8905
+  (1.3ms) DELETE FROM "categories";
8906
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';
8907
+  (1.0ms) DELETE FROM "products";
8908
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
8909
+  (1.1ms) DELETE FROM "product_has_categories";
8910
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8911
+  (0.9ms) DELETE FROM "items";
8912
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8913
+  (0.1ms) begin transaction
8914
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:11 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:11 UTC +00:00]]
8915
+  (1.5ms) commit transaction
8916
+
8917
+
8918
+ Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:47:11 +0200
8919
+ Processing by CategoriesController#new as HTML
8920
+ Rendered categories/_form.html.erb (2.5ms)
8921
+ Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)
8922
+
8923
+
8924
+ Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200
8925
+ Processing by CategoriesController#create as HTML
8926
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}
8927
+  (0.1ms) begin transaction
8928
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:11 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:11 UTC +00:00]]
8929
+  (1.4ms) commit transaction
8930
+ Redirected to http://www.example.com/categories
8931
+ Completed 302 Found in 4ms (ActiveRecord: 1.9ms)
8932
+
8933
+
8934
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200
8935
+ Processing by CategoriesController#index as HTML
8936
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" 
8937
+ Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.1ms)
8938
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1
8939
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8940
+  (0.9ms) DELETE FROM "categories";
8941
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
8942
+  (0.9ms) DELETE FROM "products";
8943
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
8944
+  (1.0ms) DELETE FROM "product_has_categories";
8945
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8946
+  (1.3ms) DELETE FROM "items";
8947
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';
8948
+  (0.1ms) begin transaction
8949
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:12 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:12 UTC +00:00]]
8950
+  (1.8ms) commit transaction
8951
+
8952
+
8953
+ Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:47:12 +0200
8954
+ Processing by CategoriesController#new as HTML
8955
+ Rendered categories/_form.html.erb (4.0ms)
8956
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
8957
+
8958
+
8959
+ Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-14 01:47:12 +0200
8960
+ Processing by CategoriesController#token as JSON
8961
+ Parameters: {"q"=>"wood"}
8962
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%')
8963
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
8964
+
8965
+
8966
+ Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:47:13 +0200
8967
+ Processing by CategoriesController#create as HTML
8968
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}
8969
+  (0.1ms) begin transaction
8970
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
8971
+  (1.0ms) commit transaction
8972
+ Redirected to http://127.0.0.1:57074/categories
8973
+ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)
8974
+
8975
+
8976
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:13 +0200
8977
+ Processing by CategoriesController#index as HTML
8978
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" 
8979
+ Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms)
8980
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1
8981
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
8982
+  (1.0ms) DELETE FROM "categories";
8983
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';
8984
+  (1.0ms) DELETE FROM "products";
8985
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
8986
+  (0.9ms) DELETE FROM "product_has_categories";
8987
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
8988
+  (0.8ms) DELETE FROM "items";
8989
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
8990
+  (0.1ms) begin transaction
8991
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
8992
+  (0.9ms) commit transaction
8993
+  (0.1ms) begin transaction
8994
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
8995
+  (1.5ms) commit transaction
8996
+  (0.0ms) begin transaction
8997
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
8998
+  (0.9ms) commit transaction
8999
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9000
+
9001
+
9002
+ Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:47:13 +0200
9003
+ Processing by CategoriesController#edit as HTML
9004
+ Parameters: {"id"=>"3"}
9005
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
9006
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9007
+ Rendered categories/_form.html.erb (4.1ms)
9008
+ Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.3ms)
9009
+
9010
+
9011
+ Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:47:13 +0200
9012
+ Processing by CategoriesController#update as HTML
9013
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}
9014
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
9015
+  (0.0ms) begin transaction
9016
+  (0.2ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:47:13.590811' WHERE "categories"."id" = 3
9017
+  (1.1ms) commit transaction
9018
+ Redirected to http://www.example.com/categories
9019
+ Completed 302 Found in 3ms (ActiveRecord: 1.4ms)
9020
+
9021
+
9022
+ Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:13 +0200
9023
+ Processing by CategoriesController#index as HTML
9024
+ Category Load (0.1ms) SELECT "categories".* FROM "categories"
9025
+ Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.1ms)
9026
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]
9027
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9028
+  (1.0ms) DELETE FROM "categories";
9029
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
9030
+  (0.9ms) DELETE FROM "products";
9031
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
9032
+  (0.8ms) DELETE FROM "product_has_categories";
9033
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9034
+  (0.9ms) DELETE FROM "items";
9035
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
9036
+  (0.1ms) begin transaction
9037
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
9038
+  (1.7ms) commit transaction
9039
+  (0.0ms) begin transaction
9040
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
9041
+  (1.3ms) commit transaction
9042
+  (0.0ms) begin transaction
9043
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
9044
+  (1.1ms) commit transaction
9045
+  (0.1ms) begin transaction
9046
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 23:47:13 UTC +00:00]]
9047
+  (1.0ms) commit transaction
9048
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9049
+
9050
+
9051
+ Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:47:13 +0200
9052
+ Processing by ItemsController#edit as HTML
9053
+ Parameters: {"id"=>"1"}
9054
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9055
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9056
+ Rendered items/_form.html.erb (63.4ms)
9057
+ Completed 200 OK in 68ms (Views: 66.1ms | ActiveRecord: 0.5ms)
9058
+
9059
+
9060
+ Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:47:14 +0200
9061
+ Processing by CategoriesController#token as JSON
9062
+ Parameters: {"q"=>"skirt"}
9063
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%')
9064
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)
9065
+
9066
+
9067
+ Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9068
+ Processing by ItemsController#update as HTML
9069
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}
9070
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9071
+  (0.1ms) begin transaction
9072
+  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:47:15.138499' WHERE "items"."id" = 1
9073
+  (0.9ms) commit transaction
9074
+ Redirected to http://127.0.0.1:57074/items
9075
+ Completed 302 Found in 6ms (ActiveRecord: 1.5ms)
9076
+
9077
+
9078
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9079
+ Processing by ItemsController#index as HTML
9080
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
9081
+ Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.1ms)
9082
+ Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]
9083
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9084
+  (1.2ms) DELETE FROM "categories";
9085
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
9086
+  (1.2ms) DELETE FROM "products";
9087
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';
9088
+  (1.0ms) DELETE FROM "product_has_categories";
9089
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9090
+  (1.1ms) DELETE FROM "items";
9091
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';
9092
+  (0.1ms) begin transaction
9093
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9094
+  (1.8ms) commit transaction
9095
+  (0.1ms) begin transaction
9096
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9097
+  (1.2ms) commit transaction
9098
+  (0.0ms) begin transaction
9099
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9100
+  (0.9ms) commit transaction
9101
+  (0.0ms) begin transaction
9102
+ SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9103
+  (1.9ms) commit transaction
9104
+
9105
+
9106
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9107
+ Processing by ItemsController#index as HTML
9108
+ Item Load (0.2ms) SELECT "items".* FROM "items"
9109
+ Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms)
9110
+  (1.2ms) DELETE FROM "categories";
9111
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
9112
+  (1.9ms) DELETE FROM "products";
9113
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9114
+  (1.0ms) DELETE FROM "product_has_categories";
9115
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9116
+  (0.9ms) DELETE FROM "items";
9117
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';
9118
+  (0.1ms) begin transaction
9119
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9120
+  (1.7ms) commit transaction
9121
+  (0.1ms) begin transaction
9122
+ SQL (31.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9123
+  (1.0ms) commit transaction
9124
+  (0.1ms) begin transaction
9125
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9126
+  (0.8ms) commit transaction
9127
+
9128
+
9129
+ Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9130
+ Processing by ItemsController#new as HTML
9131
+ Rendered items/_form.html.erb (4.3ms)
9132
+ Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms)
9133
+
9134
+
9135
+ Started POST "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9136
+ Processing by ItemsController#create as HTML
9137
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}
9138
+  (0.1ms) begin transaction
9139
+ SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9140
+  (1.5ms) commit transaction
9141
+ Redirected to http://www.example.com/items
9142
+ Completed 302 Found in 4ms (ActiveRecord: 2.0ms)
9143
+
9144
+
9145
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9146
+ Processing by ItemsController#index as HTML
9147
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
9148
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms)
9149
+ Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1
9150
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9151
+  (0.9ms) DELETE FROM "categories";
9152
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
9153
+  (0.9ms) DELETE FROM "products";
9154
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9155
+  (1.0ms) DELETE FROM "product_has_categories";
9156
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9157
+  (0.8ms) DELETE FROM "items";
9158
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';
9159
+  (0.1ms) begin transaction
9160
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9161
+  (1.7ms) commit transaction
9162
+  (0.0ms) begin transaction
9163
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9164
+  (1.0ms) commit transaction
9165
+  (0.1ms) begin transaction
9166
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:15 UTC +00:00]]
9167
+  (0.8ms) commit transaction
9168
+
9169
+
9170
+ Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:47:15 +0200
9171
+ Processing by ItemsController#new as HTML
9172
+ Rendered items/_form.html.erb (3.6ms)
9173
+ Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)
9174
+
9175
+
9176
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:47:16 +0200
9177
+ Processing by CategoriesController#token as JSON
9178
+ Parameters: {"q"=>"shoes"}
9179
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
9180
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
9181
+
9182
+
9183
+ Started POST "/items" for 127.0.0.1 at 2012-10-14 01:47:16 +0200
9184
+ Processing by ItemsController#create as HTML
9185
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}
9186
+  (0.1ms) begin transaction
9187
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00]]
9188
+  (1.0ms) commit transaction
9189
+ Redirected to http://127.0.0.1:57074/items
9190
+ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)
9191
+
9192
+
9193
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:16 +0200
9194
+ Processing by ItemsController#index as HTML
9195
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
9196
+ Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.1ms)
9197
+ Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1
9198
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9199
+  (0.9ms) DELETE FROM "categories";
9200
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';
9201
+  (1.0ms) DELETE FROM "products";
9202
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9203
+  (1.1ms) DELETE FROM "product_has_categories";
9204
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9205
+  (0.9ms) DELETE FROM "items";
9206
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
9207
+  (0.1ms) begin transaction
9208
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00]]
9209
+  (1.4ms) commit transaction
9210
+  (0.1ms) begin transaction
9211
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00]]
9212
+  (0.9ms) commit transaction
9213
+  (0.0ms) begin transaction
9214
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00]]
9215
+  (1.0ms) commit transaction
9216
+  (0.0ms) begin transaction
9217
+ SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 23:47:16 UTC +00:00]]
9218
+  (0.9ms) commit transaction
9219
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9220
+
9221
+
9222
+ Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:47:16 +0200
9223
+ Processing by ItemsController#edit as HTML
9224
+ Parameters: {"id"=>"1"}
9225
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9226
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9227
+ Rendered items/_form.html.erb (4.8ms)
9228
+ Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.2ms)
9229
+
9230
+
9231
+ Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:47:17 +0200
9232
+ Processing by ItemsController#update as HTML
9233
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}
9234
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9235
+  (0.1ms) begin transaction
9236
+  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:47:17.010915' WHERE "items"."id" = 1
9237
+  (1.1ms) commit transaction
9238
+ Redirected to http://www.example.com/items
9239
+ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)
9240
+
9241
+
9242
+ Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:17 +0200
9243
+ Processing by ItemsController#index as HTML
9244
+ Item Load (0.2ms) SELECT "items".* FROM "items" 
9245
+ Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms)
9246
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]
9247
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9248
+  (1.2ms) DELETE FROM "categories";
9249
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';
9250
+  (1.0ms) DELETE FROM "products";
9251
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9252
+  (1.0ms) DELETE FROM "product_has_categories";
9253
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9254
+  (1.1ms) DELETE FROM "items";
9255
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
9256
+  (0.1ms) begin transaction
9257
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00]]
9258
+  (1.7ms) commit transaction
9259
+  (0.0ms) begin transaction
9260
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00]]
9261
+  (0.7ms) commit transaction
9262
+  (0.1ms) begin transaction
9263
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00]]
9264
+  (0.9ms) commit transaction
9265
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
9266
+  (0.0ms) begin transaction
9267
+ SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00]]
9268
+ SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00]]
9269
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:17 UTC +00:00]]
9270
+  (1.6ms) commit transaction
9271
+
9272
+
9273
+ Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:47:17 +0200
9274
+ Processing by ProductsController#edit as HTML
9275
+ Parameters: {"id"=>"1"}
9276
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
9277
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9278
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9279
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9280
+ Rendered products/_form.html.erb (18.4ms)
9281
+ Completed 200 OK in 23ms (Views: 20.8ms | ActiveRecord: 1.0ms)
9282
+
9283
+
9284
+ Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:47:17 +0200
9285
+ Processing by CategoriesController#token as JSON
9286
+ Parameters: {"q"=>"skirt"}
9287
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%')
9288
+ Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms)
9289
+
9290
+
9291
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:47:19 +0200
9292
+ Processing by CategoriesController#token as JSON
9293
+ Parameters: {"q"=>"shoes"}
9294
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
9295
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)
9296
+
9297
+
9298
+ Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:47:19 +0200
9299
+ Processing by ProductsController#update as HTML
9300
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"}
9301
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
9302
+  (0.1ms) begin transaction
9303
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1)
9304
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9305
+ SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3
9306
+ SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 23:47:19 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:19 UTC +00:00]]
9307
+  (1.1ms) commit transaction
9308
+ Redirected to http://127.0.0.1:57074/products
9309
+ Completed 302 Found in 14ms (ActiveRecord: 2.4ms)
9310
+
9311
+
9312
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:19 +0200
9313
+ Processing by ProductsController#index as HTML
9314
+ Product Load (0.1ms) SELECT "products".* FROM "products"
9315
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9316
+ Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms)
9317
+ Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]
9318
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9319
+  (0.9ms) DELETE FROM "categories";
9320
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
9321
+  (0.8ms) DELETE FROM "products";
9322
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';
9323
+  (0.9ms) DELETE FROM "product_has_categories";
9324
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9325
+  (1.1ms) DELETE FROM "items";
9326
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';
9327
+  (0.1ms) begin transaction
9328
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9329
+  (1.8ms) commit transaction
9330
+  (0.1ms) begin transaction
9331
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9332
+  (1.0ms) commit transaction
9333
+  (0.1ms) begin transaction
9334
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9335
+  (0.9ms) commit transaction
9336
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)
9337
+  (0.1ms) begin transaction
9338
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9339
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9340
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9341
+  (1.2ms) commit transaction
9342
+
9343
+
9344
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:20 +0200
9345
+ Processing by ProductsController#index as HTML
9346
+ Product Load (0.1ms) SELECT "products".* FROM "products" 
9347
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9348
+ Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.3ms)
9349
+  (1.1ms) DELETE FROM "categories";
9350
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9351
+  (1.0ms) DELETE FROM "products";
9352
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';
9353
+  (1.0ms) DELETE FROM "product_has_categories";
9354
+  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9355
+  (1.1ms) DELETE FROM "items";
9356
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';
9357
+  (0.1ms) begin transaction
9358
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9359
+  (1.8ms) commit transaction
9360
+  (0.1ms) begin transaction
9361
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9362
+  (0.9ms) commit transaction
9363
+  (0.1ms) begin transaction
9364
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9365
+  (1.0ms) commit transaction
9366
+
9367
+
9368
+ Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:47:20 +0200
9369
+ Processing by ProductsController#new as HTML
9370
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
9371
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
9372
+ Rendered products/_form.html.erb (4.6ms)
9373
+ Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.2ms)
9374
+
9375
+
9376
+ Started POST "/products" for 127.0.0.1 at 2012-10-14 01:47:20 +0200
9377
+ Processing by ProductsController#create as HTML
9378
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"}
9379
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)
9380
+  (0.0ms) begin transaction
9381
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9382
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9383
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9384
+  (1.0ms) commit transaction
9385
+ Redirected to http://www.example.com/products
9386
+ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)
9387
+
9388
+
9389
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:20 +0200
9390
+ Processing by ProductsController#index as HTML
9391
+ Product Load (0.1ms) SELECT "products".* FROM "products"
9392
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9393
+ Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.3ms)
9394
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1
9395
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9396
+  (1.9ms) DELETE FROM "categories";
9397
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';
9398
+  (1.0ms) DELETE FROM "products";
9399
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';
9400
+  (0.9ms) DELETE FROM "product_has_categories";
9401
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9402
+  (0.8ms) DELETE FROM "items";
9403
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';
9404
+  (0.1ms) begin transaction
9405
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9406
+  (1.8ms) commit transaction
9407
+  (0.1ms) begin transaction
9408
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9409
+  (1.0ms) commit transaction
9410
+  (0.1ms) begin transaction
9411
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:20 UTC +00:00]]
9412
+  (1.6ms) commit transaction
9413
+
9414
+
9415
+ Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:47:20 +0200
9416
+ Processing by ProductsController#new as HTML
9417
+  (0.2ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
9418
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" IS NULL
9419
+ Rendered products/_form.html.erb (6.0ms)
9420
+ Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.3ms)
9421
+
9422
+
9423
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:47:20 +0200
9424
+ Processing by CategoriesController#token as JSON
9425
+ Parameters: {"q"=>"shoes"}
9426
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
9427
+ Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms)
9428
+
9429
+
9430
+ Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-14 01:47:22 +0200
9431
+ Processing by CategoriesController#token as JSON
9432
+ Parameters: {"q"=>"pents"}
9433
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%')
9434
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)
9435
+
9436
+
9437
+ Started POST "/products" for 127.0.0.1 at 2012-10-14 01:47:23 +0200
9438
+ Processing by ProductsController#create as HTML
9439
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"}
9440
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
9441
+  (0.1ms) begin transaction
9442
+ SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9443
+ SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9444
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9445
+  (2.5ms) commit transaction
9446
+ Redirected to http://127.0.0.1:57074/products
9447
+ Completed 302 Found in 11ms (ActiveRecord: 4.0ms)
9448
+
9449
+
9450
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:23 +0200
9451
+ Processing by ProductsController#index as HTML
9452
+ Product Load (0.1ms) SELECT "products".* FROM "products" 
9453
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9454
+ Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms)
9455
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1
9456
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9457
+  (1.5ms) DELETE FROM "categories";
9458
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9459
+  (1.0ms) DELETE FROM "products";
9460
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';
9461
+  (0.9ms) DELETE FROM "product_has_categories";
9462
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9463
+  (0.9ms) DELETE FROM "items";
9464
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
9465
+  (0.1ms) begin transaction
9466
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9467
+  (1.5ms) commit transaction
9468
+  (0.1ms) begin transaction
9469
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9470
+  (1.1ms) commit transaction
9471
+  (0.1ms) begin transaction
9472
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9473
+  (0.9ms) commit transaction
9474
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
9475
+  (0.1ms) begin transaction
9476
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9477
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9478
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9479
+  (1.2ms) commit transaction
9480
+
9481
+
9482
+ Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:47:23 +0200
9483
+ Processing by ProductsController#edit as HTML
9484
+ Parameters: {"id"=>"1"}
9485
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
9486
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9487
+  (0.1ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9488
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9489
+ Rendered products/_form.html.erb (6.4ms)
9490
+ Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.5ms)
9491
+
9492
+
9493
+ Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:47:23 +0200
9494
+ Processing by ProductsController#update as HTML
9495
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"}
9496
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
9497
+  (0.1ms) begin transaction
9498
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1)
9499
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9500
+ SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3
9501
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 23:47:23 UTC +00:00]]
9502
+  (1.6ms) commit transaction
9503
+ Redirected to http://www.example.com/products
9504
+ Completed 302 Found in 7ms (ActiveRecord: 2.4ms)
9505
+
9506
+
9507
+ Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:23 +0200
9508
+ Processing by ProductsController#index as HTML
9509
+ Product Load (0.1ms) SELECT "products".* FROM "products" 
9510
+  (0.1ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9511
+ Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms)
9512
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]
9513
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1
9514
+  (1.1ms) DELETE FROM "categories";
9515
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9516
+  (0.9ms) DELETE FROM "products";
9517
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';
9518
+  (0.9ms) DELETE FROM "product_has_categories";
9519
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9520
+  (0.9ms) DELETE FROM "items";
9521
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';