token_field 1.0.0 → 1.0.1

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.
@@ -113,6 +113,7 @@ module TokenField
113
113
  elsif append_to_id && append_to_id != :id
114
114
  html_id << "_#{append_to_id}"
115
115
  end
116
+ html_id = html_id.parameterize.underscore
116
117
 
117
118
  value = nil
118
119
  data_pre = nil
@@ -127,8 +128,7 @@ module TokenField
127
128
  on_add = options[:on_add] ? "#{options[:on_add]}" : "false"
128
129
  on_delete = options[:on_delete] ? "#{options[:on_delete]}" : "false"
129
130
 
130
- text_field("#{attribute_name}", "data-pre" => data_pre, :value => value, :id => html_id)+
131
- javascript_tag("
131
+ js_content = "
132
132
  jQuery.noConflict();
133
133
  jQuery(function() {
134
134
  jQuery('##{html_id}').tokenInput('#{token_url}', {
@@ -144,7 +144,9 @@ module TokenField
144
144
  onDelete: "+on_delete+"
145
145
  });
146
146
  });
147
- ")
147
+ "
148
+ script = content_tag(:script, js_content.html_safe, :type => Mime::JS)
149
+ text_field("#{attribute_name}", "data-pre" => data_pre, :value => value, :id => html_id) + script
148
150
  end
149
151
  end
150
152
  end
@@ -1,3 +1,3 @@
1
1
  module TokenField
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
Binary file
@@ -3125,3 +3125,5 @@ Served asset /application.js - 304 Not Modified (0ms)
3125
3125
 
3126
3126
  Started GET "/assets/jquery.tokeninput.js?body=1" for 127.0.0.1 at 2012-10-13 23:58:30 +0200
3127
3127
  Served asset /jquery.tokeninput.js - 304 Not Modified (0ms)
3128
+ Connecting to database specified by database.yml
3129
+ Connecting to database specified by database.yml
@@ -9519,3 +9519,693 @@ Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms)
9519
9519
   (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9520
9520
   (0.9ms) DELETE FROM "items";
9521
9521
   (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
9522
+ Connecting to database specified by database.yml
9523
+  (0.1ms) begin transaction
9524
+ SQL (38.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00]]
9525
+  (0.9ms) commit transaction
9526
+  (0.1ms) begin transaction
9527
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00]]
9528
+  (0.9ms) commit transaction
9529
+  (0.0ms) begin transaction
9530
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00]]
9531
+  (0.9ms) commit transaction
9532
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9533
+
9534
+
9535
+ Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-24 16:49:19 +0200
9536
+ Processing by CategoriesController#edit as HTML
9537
+ Parameters: {"id"=>"3"}
9538
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
9539
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9540
+ Rendered categories/_form.html.erb (143.2ms)
9541
+ Rendered categories/edit.html.erb within layouts/application (159.9ms)
9542
+ Completed 200 OK in 202ms (Views: 200.3ms | ActiveRecord: 0.4ms)
9543
+
9544
+
9545
+ Started PUT "/categories/3" for 127.0.0.1 at 2012-10-24 16:49:19 +0200
9546
+ Processing by CategoriesController#update as HTML
9547
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}
9548
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
9549
+  (0.1ms) begin transaction
9550
+  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-24 14:49:19.576089' WHERE "categories"."id" = 3
9551
+  (0.8ms) commit transaction
9552
+ Redirected to http://www.example.com/categories
9553
+ Completed 302 Found in 6ms (ActiveRecord: 1.3ms)
9554
+
9555
+
9556
+ Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:19 +0200
9557
+ Processing by CategoriesController#index as HTML
9558
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" 
9559
+ Rendered categories/index.html.erb within layouts/application (2.0ms)
9560
+ Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.2ms)
9561
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]
9562
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9563
+  (1.0ms) DELETE FROM "categories";
9564
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9565
+  (67.9ms) DELETE FROM "products";
9566
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9567
+  (1.0ms) DELETE FROM "product_has_categories";
9568
+  (11.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9569
+  (1.2ms) DELETE FROM "items";
9570
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';
9571
+  (0.1ms) begin transaction
9572
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00]]
9573
+  (0.8ms) commit transaction
9574
+  (0.1ms) begin transaction
9575
+ SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00]]
9576
+  (1.1ms) commit transaction
9577
+  (0.1ms) begin transaction
9578
+ SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:19 UTC +00:00]]
9579
+  (1.2ms) commit transaction
9580
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9581
+
9582
+
9583
+ Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-24 16:49:27 +0200
9584
+ Processing by CategoriesController#edit as HTML
9585
+ Parameters: {"id"=>"3"}
9586
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
9587
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9588
+ Rendered categories/_form.html.erb (9.0ms)
9589
+ Completed 200 OK in 16ms (Views: 12.6ms | ActiveRecord: 0.9ms)
9590
+
9591
+
9592
+ Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-24 16:49:27 +0200
9593
+ Served asset /application.css - 200 OK (42ms)
9594
+
9595
+
9596
+ Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-24 16:49:27 +0200
9597
+ Served asset /application.js - 200 OK (15ms)
9598
+
9599
+
9600
+ Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-24 16:49:28 +0200
9601
+ Processing by CategoriesController#token as JSON
9602
+ Parameters: {"q"=>"new parent"}
9603
+ Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%')
9604
+ Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.4ms)
9605
+
9606
+
9607
+ Started PUT "/categories/3" for 127.0.0.1 at 2012-10-24 16:49:29 +0200
9608
+ Processing by CategoriesController#update as HTML
9609
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}
9610
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]
9611
+  (0.1ms) begin transaction
9612
+  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-24 14:49:29.265141' WHERE "categories"."id" = 3
9613
+  (0.9ms) commit transaction
9614
+ Redirected to http://127.0.0.1:51454/categories
9615
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
9616
+
9617
+
9618
+ Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:29 +0200
9619
+ Processing by CategoriesController#index as HTML
9620
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" 
9621
+ Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.3ms)
9622
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]
9623
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9624
+  (113.9ms) DELETE FROM "categories";
9625
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';
9626
+  (1.3ms) DELETE FROM "products";
9627
+  (128.3ms) DELETE FROM sqlite_sequence where name = 'products';
9628
+  (4.6ms) DELETE FROM "product_has_categories";
9629
+  (1.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9630
+  (2.6ms) DELETE FROM "items";
9631
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';
9632
+  (0.1ms) begin transaction
9633
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:29 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:29 UTC +00:00]]
9634
+  (167.3ms) commit transaction
9635
+
9636
+
9637
+ Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:29 +0200
9638
+ Processing by CategoriesController#index as HTML
9639
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" 
9640
+ Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms)
9641
+  (1.9ms) DELETE FROM "categories";
9642
+  (9.9ms) DELETE FROM sqlite_sequence where name = 'categories';
9643
+  (12.7ms) DELETE FROM "products";
9644
+  (9.1ms) DELETE FROM sqlite_sequence where name = 'products';
9645
+  (60.1ms) DELETE FROM "product_has_categories";
9646
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9647
+  (92.2ms) DELETE FROM "items";
9648
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
9649
+  (0.1ms) begin transaction
9650
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:30 UTC +00:00]]
9651
+  (0.9ms) commit transaction
9652
+
9653
+
9654
+ Started GET "/categories/new" for 127.0.0.1 at 2012-10-24 16:49:30 +0200
9655
+ Processing by CategoriesController#new as HTML
9656
+ Rendered categories/_form.html.erb (4.1ms)
9657
+ Completed 200 OK in 36ms (Views: 35.1ms | ActiveRecord: 0.0ms)
9658
+
9659
+
9660
+ Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-24 16:49:30 +0200
9661
+ Processing by CategoriesController#token as JSON
9662
+ Parameters: {"q"=>"wood"}
9663
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%')
9664
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
9665
+
9666
+
9667
+ Started POST "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200
9668
+ Processing by CategoriesController#create as HTML
9669
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}
9670
+  (0.1ms) begin transaction
9671
+ SQL (3.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9672
+  (3.9ms) commit transaction
9673
+ Redirected to http://127.0.0.1:51454/categories
9674
+ Completed 302 Found in 11ms (ActiveRecord: 7.6ms)
9675
+
9676
+
9677
+ Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200
9678
+ Processing by CategoriesController#index as HTML
9679
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" 
9680
+ Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms)
9681
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1
9682
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9683
+  (1.1ms) DELETE FROM "categories";
9684
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';
9685
+  (1.2ms) DELETE FROM "products";
9686
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
9687
+  (1.2ms) DELETE FROM "product_has_categories";
9688
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9689
+  (1.1ms) DELETE FROM "items";
9690
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';
9691
+  (0.1ms) begin transaction
9692
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9693
+  (1.2ms) commit transaction
9694
+
9695
+
9696
+ Started GET "/categories/new" for 127.0.0.1 at 2012-10-24 16:49:31 +0200
9697
+ Processing by CategoriesController#new as HTML
9698
+ Rendered categories/_form.html.erb (2.7ms)
9699
+ Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)
9700
+
9701
+
9702
+ Started POST "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200
9703
+ Processing by CategoriesController#create as HTML
9704
+ Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}
9705
+  (0.1ms) begin transaction
9706
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9707
+  (1.0ms) commit transaction
9708
+ Redirected to http://www.example.com/categories
9709
+ Completed 302 Found in 5ms (ActiveRecord: 1.7ms)
9710
+
9711
+
9712
+ Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200
9713
+ Processing by CategoriesController#index as HTML
9714
+ Category Load (0.2ms) SELECT "categories".* FROM "categories"
9715
+ Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms)
9716
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1
9717
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9718
+  (1.2ms) DELETE FROM "categories";
9719
+  (1.6ms) DELETE FROM sqlite_sequence where name = 'categories';
9720
+  (0.9ms) DELETE FROM "products";
9721
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
9722
+  (0.9ms) DELETE FROM "product_has_categories";
9723
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9724
+  (0.9ms) DELETE FROM "items";
9725
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
9726
+  (0.1ms) begin transaction
9727
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9728
+  (2.1ms) commit transaction
9729
+  (0.1ms) begin transaction
9730
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9731
+  (1.2ms) commit transaction
9732
+  (0.1ms) begin transaction
9733
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9734
+  (1.2ms) commit transaction
9735
+  (0.1ms) begin transaction
9736
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "item"], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]
9737
+  (1.2ms) commit transaction
9738
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9739
+
9740
+
9741
+ Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-24 16:49:31 +0200
9742
+ Processing by ItemsController#edit as HTML
9743
+ Parameters: {"id"=>"1"}
9744
+ Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9745
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9746
+ Rendered items/_form.html.erb (81.0ms)
9747
+ Completed 200 OK in 134ms (Views: 131.9ms | ActiveRecord: 0.4ms)
9748
+
9749
+
9750
+ Started PUT "/items/1" for 127.0.0.1 at 2012-10-24 16:49:32 +0200
9751
+ Processing by ItemsController#update as HTML
9752
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}
9753
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9754
+  (0.0ms) begin transaction
9755
+  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-24 14:49:32.038199' WHERE "items"."id" = 1
9756
+  (1.6ms) commit transaction
9757
+ Redirected to http://www.example.com/items
9758
+ Completed 302 Found in 5ms (ActiveRecord: 2.1ms)
9759
+
9760
+
9761
+ Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:32 +0200
9762
+ Processing by ItemsController#index as HTML
9763
+ Item Load (0.2ms) SELECT "items".* FROM "items"
9764
+ Completed 200 OK in 44ms (Views: 42.7ms | ActiveRecord: 0.2ms)
9765
+ Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]
9766
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9767
+  (1.0ms) DELETE FROM "categories";
9768
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
9769
+  (1.1ms) DELETE FROM "products";
9770
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';
9771
+  (0.9ms) DELETE FROM "product_has_categories";
9772
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9773
+  (1.3ms) DELETE FROM "items";
9774
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';
9775
+  (0.1ms) begin transaction
9776
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00]]
9777
+  (0.8ms) commit transaction
9778
+  (0.1ms) begin transaction
9779
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00]]
9780
+  (0.9ms) commit transaction
9781
+  (0.1ms) begin transaction
9782
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00]]
9783
+  (1.1ms) commit transaction
9784
+  (0.1ms) begin transaction
9785
+ SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00], ["name", "item"], ["updated_at", Wed, 24 Oct 2012 14:49:32 UTC +00:00]]
9786
+  (1.3ms) commit transaction
9787
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9788
+
9789
+
9790
+ Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-24 16:49:32 +0200
9791
+ Processing by ItemsController#edit as HTML
9792
+ Parameters: {"id"=>"1"}
9793
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9794
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9795
+ Rendered items/_form.html.erb (7.5ms)
9796
+ Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 0.7ms)
9797
+
9798
+
9799
+ Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-24 16:49:32 +0200
9800
+ Processing by CategoriesController#token as JSON
9801
+ Parameters: {"q"=>"skirt"}
9802
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%')
9803
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms)
9804
+
9805
+
9806
+ Started PUT "/items/1" for 127.0.0.1 at 2012-10-24 16:49:33 +0200
9807
+ Processing by ItemsController#update as HTML
9808
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}
9809
+ Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]
9810
+  (0.1ms) begin transaction
9811
+  (2.6ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-24 14:49:33.550999' WHERE "items"."id" = 1
9812
+  (3.8ms) commit transaction
9813
+ Redirected to http://127.0.0.1:51454/items
9814
+ Completed 302 Found in 10ms (ActiveRecord: 6.5ms)
9815
+
9816
+
9817
+ Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:33 +0200
9818
+ Processing by ItemsController#index as HTML
9819
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
9820
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms)
9821
+ Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]
9822
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1
9823
+  (0.9ms) DELETE FROM "categories";
9824
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
9825
+  (0.8ms) DELETE FROM "products";
9826
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9827
+  (1.0ms) DELETE FROM "product_has_categories";
9828
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9829
+  (1.7ms) DELETE FROM "items";
9830
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';
9831
+  (0.1ms) begin transaction
9832
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9833
+  (0.9ms) commit transaction
9834
+  (0.1ms) begin transaction
9835
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9836
+  (1.2ms) commit transaction
9837
+  (0.1ms) begin transaction
9838
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9839
+  (1.0ms) commit transaction
9840
+  (0.0ms) begin transaction
9841
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "new one"], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9842
+  (1.0ms) commit transaction
9843
+
9844
+
9845
+ Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:33 +0200
9846
+ Processing by ItemsController#index as HTML
9847
+ Item Load (0.1ms) SELECT "items".* FROM "items"
9848
+ Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.1ms)
9849
+  (1.3ms) DELETE FROM "categories";
9850
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9851
+  (1.1ms) DELETE FROM "products";
9852
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';
9853
+  (1.0ms) DELETE FROM "product_has_categories";
9854
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9855
+  (0.9ms) DELETE FROM "items";
9856
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';
9857
+  (0.1ms) begin transaction
9858
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9859
+  (0.8ms) commit transaction
9860
+  (0.1ms) begin transaction
9861
+ SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9862
+  (1.1ms) commit transaction
9863
+  (0.1ms) begin transaction
9864
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:33 UTC +00:00]]
9865
+  (1.0ms) commit transaction
9866
+
9867
+
9868
+ Started GET "/items/new" for 127.0.0.1 at 2012-10-24 16:49:33 +0200
9869
+ Processing by ItemsController#new as HTML
9870
+ Rendered items/_form.html.erb (7.0ms)
9871
+ Completed 200 OK in 62ms (Views: 61.7ms | ActiveRecord: 0.0ms)
9872
+
9873
+
9874
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-24 16:49:34 +0200
9875
+ Processing by CategoriesController#token as JSON
9876
+ Parameters: {"q"=>"shoes"}
9877
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
9878
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
9879
+
9880
+
9881
+ Started POST "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200
9882
+ Processing by ItemsController#create as HTML
9883
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}
9884
+  (0.1ms) begin transaction
9885
+ SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "hello"], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9886
+  (250.7ms) commit transaction
9887
+ Redirected to http://127.0.0.1:51454/items
9888
+ Completed 302 Found in 254ms (ActiveRecord: 251.3ms)
9889
+
9890
+
9891
+ Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200
9892
+ Processing by ItemsController#index as HTML
9893
+ Item Load (0.2ms) SELECT "items".* FROM "items"
9894
+ Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms)
9895
+ Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1
9896
+ Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9897
+  (0.9ms) DELETE FROM "categories";
9898
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9899
+  (0.9ms) DELETE FROM "products";
9900
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9901
+  (0.9ms) DELETE FROM "product_has_categories";
9902
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9903
+  (1.4ms) DELETE FROM "items";
9904
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';
9905
+  (0.1ms) begin transaction
9906
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9907
+  (0.8ms) commit transaction
9908
+  (0.1ms) begin transaction
9909
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9910
+  (0.9ms) commit transaction
9911
+  (0.1ms) begin transaction
9912
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9913
+  (0.8ms) commit transaction
9914
+
9915
+
9916
+ Started GET "/items/new" for 127.0.0.1 at 2012-10-24 16:49:35 +0200
9917
+ Processing by ItemsController#new as HTML
9918
+ Rendered items/_form.html.erb (4.4ms)
9919
+ Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms)
9920
+
9921
+
9922
+ Started POST "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200
9923
+ Processing by ItemsController#create as HTML
9924
+ Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}
9925
+  (0.1ms) begin transaction
9926
+ SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "hello"], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9927
+  (0.9ms) commit transaction
9928
+ Redirected to http://www.example.com/items
9929
+ Completed 302 Found in 3ms (ActiveRecord: 1.4ms)
9930
+
9931
+
9932
+ Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200
9933
+ Processing by ItemsController#index as HTML
9934
+ Item Load (0.1ms) SELECT "items".* FROM "items" 
9935
+ Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms)
9936
+ Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1
9937
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1
9938
+  (0.9ms) DELETE FROM "categories";
9939
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';
9940
+  (0.9ms) DELETE FROM "products";
9941
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';
9942
+  (0.9ms) DELETE FROM "product_has_categories";
9943
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
9944
+  (1.0ms) DELETE FROM "items";
9945
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';
9946
+  (0.1ms) begin transaction
9947
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9948
+  (1.4ms) commit transaction
9949
+  (0.1ms) begin transaction
9950
+ SQL (1.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9951
+  (0.9ms) commit transaction
9952
+  (0.1ms) begin transaction
9953
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:35 UTC +00:00]]
9954
+  (0.9ms) commit transaction
9955
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
9956
+  (0.1ms) begin transaction
9957
+ SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["name", "product"], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
9958
+ SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
9959
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
9960
+  (1.3ms) commit transaction
9961
+
9962
+
9963
+ Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-24 16:49:36 +0200
9964
+ Processing by ProductsController#edit as HTML
9965
+ Parameters: {"id"=>"1"}
9966
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
9967
+  (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
9968
+  (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
9969
+ 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
9970
+ Rendered products/_form.html.erb (18.5ms)
9971
+ Completed 200 OK in 55ms (Views: 52.7ms | ActiveRecord: 0.6ms)
9972
+
9973
+
9974
+ Started PUT "/products/1" for 127.0.0.1 at 2012-10-24 16:49:36 +0200
9975
+ Processing by ProductsController#update as HTML
9976
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"}
9977
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
9978
+  (0.1ms) begin transaction
9979
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1)
9980
+ 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
9981
+ SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3
9982
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
9983
+  (1.2ms) commit transaction
9984
+ Redirected to http://www.example.com/products
9985
+ Completed 302 Found in 11ms (ActiveRecord: 2.2ms)
9986
+
9987
+
9988
+ Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:36 +0200
9989
+ Processing by ProductsController#index as HTML
9990
+ Product Load (0.2ms) SELECT "products".* FROM "products"
9991
+  (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
9992
+ Completed 200 OK in 33ms (Views: 31.8ms | ActiveRecord: 0.3ms)
9993
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]
9994
+ 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
9995
+  (1.2ms) DELETE FROM "categories";
9996
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';
9997
+  (1.0ms) DELETE FROM "products";
9998
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';
9999
+  (0.9ms) DELETE FROM "product_has_categories";
10000
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
10001
+  (0.8ms) DELETE FROM "items";
10002
+  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';
10003
+  (0.1ms) begin transaction
10004
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
10005
+  (1.0ms) commit transaction
10006
+  (0.1ms) begin transaction
10007
+ SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
10008
+  (1.2ms) commit transaction
10009
+  (0.1ms) begin transaction
10010
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
10011
+  (1.9ms) commit transaction
10012
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
10013
+  (0.1ms) begin transaction
10014
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["name", "product"], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
10015
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
10016
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:36 UTC +00:00]]
10017
+  (1.2ms) commit transaction
10018
+
10019
+
10020
+ Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-24 16:49:36 +0200
10021
+ Processing by ProductsController#edit as HTML
10022
+ Parameters: {"id"=>"1"}
10023
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
10024
+  (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
10025
+  (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
10026
+ 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
10027
+ Rendered products/_form.html.erb (6.5ms)
10028
+ Completed 200 OK in 10ms (Views: 7.6ms | ActiveRecord: 0.8ms)
10029
+
10030
+
10031
+ Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-24 16:49:36 +0200
10032
+ Processing by CategoriesController#token as JSON
10033
+ Parameters: {"q"=>"skirt"}
10034
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%')
10035
+ Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms)
10036
+
10037
+
10038
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-24 16:49:38 +0200
10039
+ Processing by CategoriesController#token as JSON
10040
+ Parameters: {"q"=>"shoes"}
10041
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
10042
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms)
10043
+
10044
+
10045
+ Started PUT "/products/1" for 127.0.0.1 at 2012-10-24 16:49:38 +0200
10046
+ Processing by ProductsController#update as HTML
10047
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"}
10048
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]
10049
+  (0.1ms) begin transaction
10050
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1)
10051
+ 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
10052
+ SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3
10053
+ SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Wed, 24 Oct 2012 14:49:38 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:38 UTC +00:00]]
10054
+  (8.0ms) commit transaction
10055
+ Redirected to http://127.0.0.1:51454/products
10056
+ Completed 302 Found in 15ms (ActiveRecord: 9.1ms)
10057
+
10058
+
10059
+ Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:39 +0200
10060
+ Processing by ProductsController#index as HTML
10061
+ Product Load (0.1ms) SELECT "products".* FROM "products"
10062
+  (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
10063
+ Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms)
10064
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]
10065
+ 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
10066
+  (1.0ms) DELETE FROM "categories";
10067
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';
10068
+  (0.9ms) DELETE FROM "products";
10069
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';
10070
+  (1.0ms) DELETE FROM "product_has_categories";
10071
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
10072
+  (1.1ms) DELETE FROM "items";
10073
+  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';
10074
+  (0.1ms) begin transaction
10075
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10076
+  (0.9ms) commit transaction
10077
+  (0.1ms) begin transaction
10078
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10079
+  (1.5ms) commit transaction
10080
+  (0.1ms) begin transaction
10081
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10082
+  (0.8ms) commit transaction
10083
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)
10084
+  (0.1ms) begin transaction
10085
+ SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "new one"], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10086
+ SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10087
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10088
+  (1.1ms) commit transaction
10089
+
10090
+
10091
+ Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:39 +0200
10092
+ Processing by ProductsController#index as HTML
10093
+ Product Load (0.2ms) SELECT "products".* FROM "products" 
10094
+  (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
10095
+ Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.3ms)
10096
+  (1.1ms) DELETE FROM "categories";
10097
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';
10098
+  (1.2ms) DELETE FROM "products";
10099
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';
10100
+  (0.9ms) DELETE FROM "product_has_categories";
10101
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
10102
+  (0.9ms) DELETE FROM "items";
10103
+  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';
10104
+  (0.1ms) begin transaction
10105
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10106
+  (0.9ms) commit transaction
10107
+  (0.1ms) begin transaction
10108
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10109
+  (1.4ms) commit transaction
10110
+  (0.1ms) begin transaction
10111
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:39 UTC +00:00]]
10112
+  (1.5ms) commit transaction
10113
+
10114
+
10115
+ Started GET "/products/new" for 127.0.0.1 at 2012-10-24 16:49:39 +0200
10116
+ Processing by ProductsController#new as HTML
10117
+  (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
10118
+  (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
10119
+ Rendered products/_form.html.erb (5.2ms)
10120
+ Completed 200 OK in 36ms (Views: 35.6ms | ActiveRecord: 0.3ms)
10121
+
10122
+
10123
+ Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-24 16:49:40 +0200
10124
+ Processing by CategoriesController#token as JSON
10125
+ Parameters: {"q"=>"shoes"}
10126
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%')
10127
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
10128
+
10129
+
10130
+ Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-24 16:49:41 +0200
10131
+ Processing by CategoriesController#token as JSON
10132
+ Parameters: {"q"=>"pents"}
10133
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%')
10134
+ Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms)
10135
+
10136
+
10137
+ Started POST "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200
10138
+ Processing by ProductsController#create as HTML
10139
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"}
10140
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)
10141
+  (0.1ms) begin transaction
10142
+ SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["name", "hello"], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10143
+ SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10144
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10145
+  (7.2ms) commit transaction
10146
+ Redirected to http://127.0.0.1:51454/products
10147
+ Completed 302 Found in 16ms (ActiveRecord: 8.6ms)
10148
+
10149
+
10150
+ Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200
10151
+ Processing by ProductsController#index as HTML
10152
+ Product Load (0.1ms) SELECT "products".* FROM "products"
10153
+  (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
10154
+ Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms)
10155
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1
10156
+ 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
10157
+  (1.3ms) DELETE FROM "categories";
10158
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';
10159
+  (1.0ms) DELETE FROM "products";
10160
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';
10161
+  (1.2ms) DELETE FROM "product_has_categories";
10162
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
10163
+  (0.9ms) DELETE FROM "items";
10164
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
10165
+  (0.1ms) begin transaction
10166
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10167
+  (0.8ms) commit transaction
10168
+  (0.1ms) begin transaction
10169
+ SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10170
+  (1.4ms) commit transaction
10171
+  (0.1ms) begin transaction
10172
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10173
+  (1.2ms) commit transaction
10174
+
10175
+
10176
+ Started GET "/products/new" for 127.0.0.1 at 2012-10-24 16:49:42 +0200
10177
+ Processing by ProductsController#new as HTML
10178
+  (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
10179
+  (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
10180
+ Rendered products/_form.html.erb (4.7ms)
10181
+ Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.3ms)
10182
+
10183
+
10184
+ Started POST "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200
10185
+ Processing by ProductsController#create as HTML
10186
+ Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"}
10187
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)
10188
+  (0.0ms) begin transaction
10189
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["name", "hello"], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10190
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10191
+ SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00], ["product_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:42 UTC +00:00]]
10192
+  (1.2ms) commit transaction
10193
+ Redirected to http://www.example.com/products
10194
+ Completed 302 Found in 7ms (ActiveRecord: 2.1ms)
10195
+
10196
+
10197
+ Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200
10198
+ Processing by ProductsController#index as HTML
10199
+ Product Load (0.2ms) SELECT "products".* FROM "products" 
10200
+  (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
10201
+ Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.4ms)
10202
+ Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1
10203
+ 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
10204
+  (1.3ms) DELETE FROM "categories";
10205
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';
10206
+  (0.8ms) DELETE FROM "products";
10207
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';
10208
+  (1.2ms) DELETE FROM "product_has_categories";
10209
+  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';
10210
+  (1.0ms) DELETE FROM "items";
10211
+  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: token_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-13 00:00:00.000000000 Z
12
+ date: 2012-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -238,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  segments:
240
240
  - 0
241
- hash: 4023241560533025862
241
+ hash: -297572229318511919
242
242
  required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  none: false
244
244
  requirements:
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  segments:
249
249
  - 0
250
- hash: 4023241560533025862
250
+ hash: -297572229318511919
251
251
  requirements: []
252
252
  rubyforge_project:
253
253
  rubygems_version: 1.8.24