Connecting to database specified by database.yml  (0.2ms) select sqlite_version(*)  (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)  (0.0ms) PRAGMA index_list("schema_migrations")  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Migrating to CreateCategories (20121012100526)  (0.0ms) begin transaction  (0.4ms) CREATE TABLE "categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "parent_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)   (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121012100526')  (1.1ms) commit transaction  (0.2ms) select sqlite_version(*)  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"   (0.0ms) PRAGMA index_list("categories") Connecting to database specified by database.yml Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:20:51 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:20:51 UTC +00:00]]  (1.5ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:20:52 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.3ms) Completed 200 OK in 42ms (Views: 40.7ms | ActiveRecord: 0.1ms)  (1.6ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (7.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:22:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:22:41 UTC +00:00]]  (2.6ms) commit transaction  (1.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:22:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:22:41 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:22:42 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 52ms (Views: 50.3ms | ActiveRecord: 0.2ms)  (2.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:22:52 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:22:52 UTC +00:00]]  (2.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:22:53 +0200 Processing by CategoriesController#new as HTML Rendered categories/new.html.erb within layouts/application (8.7ms) Completed 200 OK in 53ms (Views: 52.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 12:22:53 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"3"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:22:53 UTC +00:00], ["name", "hello"], ["parent_id", 3], ["updated_at", Fri, 12 Oct 2012 10:22:53 UTC +00:00]]  (1.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 2.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:22:53 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 7ms (Views: 4.4ms | ActiveRecord: 0.2ms)  (1.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:22:53 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:22:53 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:22:53 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms)  (1.6ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:23:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:23:41 UTC +00:00]]  (1.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:23:41 +0200 Processing by CategoriesController#new as HTML Rendered categories/new.html.erb within layouts/application (10.8ms) Completed 200 OK in 60ms (Views: 58.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 12:23:42 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"3"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:23:42 UTC +00:00], ["name", "hello"], ["parent_id", 3], ["updated_at", Fri, 12 Oct 2012 10:23:42 UTC +00:00]]  (1.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 2.6ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:23:42 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 9ms (Views: 6.5ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:23:50 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:23:50 UTC +00:00]]  (2.5ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:23:51 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.5ms) Completed 200 OK in 41ms (Views: 39.2ms | ActiveRecord: 0.1ms)  (1.3ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:23:51 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:23:51 UTC +00:00]]  (1.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:23:55 +0200 Processing by CategoriesController#new as HTML Completed 200 OK in 14ms (Views: 13.5ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-12 12:23:56 +0200 Compiled token-input.css (0ms) (pid 70964) Compiled categories.css (0ms) (pid 70964) Compiled application.css (12ms) (pid 70964) Served asset /application.css - 200 OK (52ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-12 12:23:56 +0200 Compiled jquery.js (6ms) (pid 70964) Compiled jquery_ujs.js (0ms) (pid 70964) Compiled jquery.tokeninput.js (1ms) (pid 70964) Compiled categories.js (0ms) (pid 70964) Compiled application.js (78ms) (pid 70964) Served asset /application.js - 200 OK (109ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 12:23:57 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"3"}, "commit"=>"Create Category"}  (0.4ms) begin transaction SQL (2.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:23:57 UTC +00:00], ["name", "hello"], ["parent_id", 3], ["updated_at", Fri, 12 Oct 2012 10:23:57 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:58334/categories Completed 302 Found in 8ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:23:57 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.4ms)  (79.6ms) DELETE FROM "categories";  (27.4ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:45:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:45:32 UTC +00:00]]  (2.4ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:45:32 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.8ms) Completed 200 OK in 55ms (Views: 53.3ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:45:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:45:32 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:45:32 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (13.6ms) Completed 200 OK in 50ms (Views: 49.9ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 12:45:33 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (1.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:45:33 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 10:45:33 UTC +00:00]]  (1.4ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 8ms (ActiveRecord: 2.8ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:45:33 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.2ms)  (11.1ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:45:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:45:33 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:45:37 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.8ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-12 12:45:37 +0200 Compiled token-input-facebook.css (0ms) (pid 84397) Compiled application.css (7ms) (pid 84397) Served asset /application.css - 200 OK (15ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-12 12:45:37 +0200 Compiled jquery.js (3ms) (pid 84397) Compiled jquery_ujs.js (0ms) (pid 84397) Compiled jquery.tokeninput.js (0ms) (pid 84397) Compiled application.js (24ms) (pid 84397) Served asset /application.js - 200 OK (82ms)  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:46:42 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:46:42 UTC +00:00]]  (1.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:46:47 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (48.0ms) Rendered categories/new.html.erb within layouts/application (59.4ms) Completed 200 OK in 79ms (Views: 77.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-12 12:46:47 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-12 12:46:47 +0200 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token.json?q=wood" for 127.0.0.1 at 2012-10-12 12:46:48 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 12:46:49 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:46:49 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 10:46:49 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:58658/categories Completed 302 Found in 6ms (ActiveRecord: 1.9ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:46:49 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)  (1.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:46:49 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:46:49 UTC +00:00]]  (291.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 12:46:50 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 12:46:50 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:46:50 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 10:46:50 UTC +00:00]]  (107.3ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 110ms (ActiveRecord: 107.7ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:46:50 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 10:46:50 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 10:46:50 UTC +00:00]]  (2.0ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 12:46:50 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:13:17 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:13:17 UTC +00:00]]  (1.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 13:13:23 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (15.6ms) Rendered categories/new.html.erb within layouts/application (50.9ms) Completed 200 OK in 64ms (Views: 63.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-12 13:13:23 +0200 Compiled token-input-facebook.css (0ms) (pid 1338) Compiled application.css (7ms) (pid 1338) Served asset /application.css - 200 OK (15ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-12 13:13:23 +0200 Compiled jquery.js (3ms) (pid 1338) Compiled jquery_ujs.js (0ms) (pid 1338) Compiled jquery.tokeninput.js (0ms) (pid 1338) Compiled application.js (42ms) (pid 1338) Served asset /application.js - 200 OK (54ms) Started GET "/categories/token.json?q=wood" for 127.0.0.1 at 2012-10-12 13:13:24 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.7ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 13:13:24 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:13:24 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 11:13:24 UTC +00:00]]  (150.5ms) commit transaction Redirected to http://127.0.0.1:58926/categories Completed 302 Found in 155ms (ActiveRecord: 151.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:13:25 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.1ms)  (3.3ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:13:25 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:13:25 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 13:13:25 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.1ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 13:13:25 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:13:25 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 11:13:25 UTC +00:00]]  (1.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 2.0ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:13:25 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.1ms)  (1.4ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:13:25 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:13:25 UTC +00:00]]  (1.6ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:13:25 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.2ms)  (1.4ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:14:07 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.4ms) Completed 200 OK in 42ms (Views: 41.0ms | ActiveRecord: 0.1ms)  (1.2ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00]]  (1.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 13:14:07 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (35.8ms) Completed 200 OK in 42ms (Views: 41.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 13:14:07 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:14:07 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms)  (1.2ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:14:07 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 13:14:12 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (6.2ms) Completed 200 OK in 16ms (Views: 14.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-12 13:14:12 +0200 Served asset /application.js - 200 OK (21ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-12 13:14:12 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/categories/token.json?q=wood" for 127.0.0.1 at 2012-10-12 13:14:13 +0200  (2.5ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:17:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:17:16 UTC +00:00]]  (2.6ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:17:17 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (4.3ms) Completed 200 OK in 46ms (Views: 44.4ms | ActiveRecord: 0.1ms)  (2.4ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:17:17 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:17:17 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 13:17:21 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (21.3ms) Completed 200 OK in 30ms (Views: 29.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-12 13:17:21 +0200 Compiled token-input-facebook.css (0ms) (pid 3818) Compiled application.css (8ms) (pid 3818) Served asset /application.css - 200 OK (18ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-12 13:17:21 +0200 Compiled jquery.js (4ms) (pid 3818) Compiled jquery_ujs.js (0ms) (pid 3818) Compiled jquery.tokeninput.js (0ms) (pid 3818) Compiled application.js (51ms) (pid 3818) Served asset /application.js - 200 OK (62ms) Started GET "/categories/token.json?q=wood" for 127.0.0.1 at 2012-10-12 13:17:22 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 13:17:23 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (359.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:17:23 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 11:17:23 UTC +00:00]]  (106.0ms) commit transaction Redirected to http://127.0.0.1:59135/categories Completed 302 Found in 470ms (ActiveRecord: 465.8ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:17:23 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 6ms (Views: 4.0ms | ActiveRecord: 0.2ms)  (1.6ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:17:23 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 11:17:23 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-12 13:17:23 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.6ms) Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-12 13:17:23 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 11:17:23 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 11:17:23 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 2.1ms) Started GET "/categories" for 127.0.0.1 at 2012-10-12 13:17:24 +0200 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 6ms (Views: 2.6ms | ActiveRecord: 0.3ms)  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 01:52:11 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.4ms) Completed 200 OK in 79ms (Views: 78.0ms | ActiveRecord: 0.1ms)  (1.6ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00]]  (1.4ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 01:52:11 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (48.6ms) Completed 200 OK in 118ms (Views: 117.9ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 01:52:11 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.8ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 01:52:11 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Fri, 12 Oct 2012 23:52:11 UTC +00:00]]  (1.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 01:52:21 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (5.8ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 01:52:21 +0200 Compiled token-input-facebook.css (0ms) (pid 49019) Compiled application.css (5ms) (pid 49019) Served asset /application.css - 200 OK (219ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 01:52:21 +0200 Compiled jquery.js (4ms) (pid 49019) Compiled jquery_ujs.js (0ms) (pid 49019) Compiled jquery.tokeninput.js (0ms) (pid 49019) Compiled application.js (138ms) (pid 49019) Served asset /application.js - 200 OK (247ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 01:52:22 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 01:52:23 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Fri, 12 Oct 2012 23:52:23 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Fri, 12 Oct 2012 23:52:23 UTC +00:00]]  (542.4ms) commit transaction Redirected to http://127.0.0.1:58139/categories Completed 302 Found in 547ms (ActiveRecord: 543.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 01:52:25 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms)  (1.1ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories'; Connecting to database specified by database.yml  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Migrating to CreateCategories (20121012100526) Migrating to CreateProducts (20121012235444)  (0.0ms) select sqlite_version(*)  (0.0ms) begin transaction  (0.6ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121012235444')  (2.6ms) commit transaction Migrating to CreateProductHasCategories (20121012235509)  (0.1ms) begin transaction  (0.3ms) CREATE TABLE "product_has_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "category_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121012235509')  (1.8ms) commit transaction  (0.3ms) select sqlite_version(*)  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  (0.1ms) PRAGMA index_list("categories")  (0.0ms) PRAGMA index_list("product_has_categories")  (0.0ms) PRAGMA index_list("products") Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:41 UTC +00:00], ["name", "shoes"], ["updated_at", Sat, 13 Oct 2012 00:23:41 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:41 UTC +00:00], ["name", "skirt"], ["updated_at", Sat, 13 Oct 2012 00:23:41 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:41 UTC +00:00], ["name", "pents"], ["updated_at", Sat, 13 Oct 2012 00:23:41 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 02:23:48 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (211.2ms) Rendered products/new.html.erb within layouts/application (221.3ms) Completed 200 OK in 243ms (Views: 241.1ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 02:23:48 +0200 Served asset /application.css - 200 OK (23ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 02:23:48 +0200 Served asset /application.js - 200 OK (107ms)  (390.3ms) DELETE FROM "categories";  (18.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (14.5ms) DELETE FROM "products";  (15.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:51 UTC +00:00], ["name", "shoes"], ["updated_at", Sat, 13 Oct 2012 00:23:51 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:51 UTC +00:00], ["name", "skirt"], ["updated_at", Sat, 13 Oct 2012 00:23:51 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:51 UTC +00:00], ["name", "pents"], ["updated_at", Sat, 13 Oct 2012 00:23:51 UTC +00:00]]  (1.3ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 02:23:51 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.1ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.5ms)  (1.8ms) DELETE FROM "categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.8ms) DELETE FROM "products";  (1.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:52 UTC +00:00], ["name", "shoes"], ["updated_at", Sat, 13 Oct 2012 00:23:52 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:52 UTC +00:00], ["name", "skirt"], ["updated_at", Sat, 13 Oct 2012 00:23:52 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 00:23:52 UTC +00:00], ["name", "pents"], ["updated_at", Sat, 13 Oct 2012 00:23:52 UTC +00:00]]  (1.2ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 02:23:52 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.1ms)  (1.3ms) DELETE FROM "categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (1.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.8ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (13.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:14:41 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:14:41 UTC +00:00]]  (4.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:14:41 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:14:41 UTC +00:00]]  (5.6ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:14:41 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:14:41 UTC +00:00]]  (3.5ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:14:59 +0200 Processing by ProductsController#new as HTML  (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  (0.3ms) 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 Rendered products/_form.html.erb (206.9ms) Rendered products/new.html.erb within layouts/application (658.7ms) Completed 200 OK in 689ms (Views: 678.7ms | ActiveRecord: 1.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:15:00 +0200 Compiled token-input-facebook.css (0ms) (pid 2008) Compiled application.css (16ms) (pid 2008) Served asset /application.css - 200 OK (67ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:15:00 +0200 Compiled jquery.js (5ms) (pid 2008) Compiled jquery_ujs.js (0ms) (pid 2008) Compiled jquery.tokeninput.js (0ms) (pid 2008) Compiled application.js (39ms) (pid 2008) Served asset /application.js - 200 OK (621ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 12:15:04 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 12:15:05 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:15:07 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (96.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:07 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:15:07 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 10:15:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:15:07 UTC +00:00]] 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 10:15:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:15:07 UTC +00:00]]  (1.4ms) commit transaction Redirected to http://127.0.0.1:59772/products Completed 302 Found in 140ms (ActiveRecord: 98.8ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:15:07 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (3.7ms) Completed 200 OK in 8ms (Views: 6.1ms | ActiveRecord: 0.4ms)  (1.4ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (1.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:15:10 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (7.4ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.4ms)  (2.0ms) DELETE FROM "categories";  (7.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (13.9ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (20.3ms) DELETE FROM "product_has_categories";  (102.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]] SQL (0.8ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]] 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 10:15:10 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:15:10 UTC +00:00]]  (86.9ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 12:15:11 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 7ms (Views: 4.9ms | ActiveRecord: 0.6ms)  (17.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (13.2ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:46 UTC +00:00]]  (3.2ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:46 UTC +00:00]]  (3.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:15:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:15:46 UTC +00:00]]  (8.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:15:46 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (135.0ms) Rendered products/new.html.erb within layouts/application (140.1ms) Completed 200 OK in 187ms (Views: 180.4ms | ActiveRecord: 0.7ms)  (2.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (5.5ms) DELETE FROM "products";  (2.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:12 UTC +00:00]]  (1.8ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:12 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:12 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:16:12 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (93.0ms) Rendered products/new.html.erb within layouts/application (135.3ms) Completed 200 OK in 153ms (Views: 146.6ms | ActiveRecord: 0.9ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:16:13 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:13 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:16:13 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 10:16:13 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:13 UTC +00:00]] 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 10:16:13 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:13 UTC +00:00]]  (1.4ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 24ms (ActiveRecord: 2.6ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:16:13 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 7ms (Views: 4.8ms | ActiveRecord: 0.4ms)  (1.7ms) DELETE FROM "categories";  (1.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (1.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.7ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (7.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:18 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:18 UTC +00:00]]  (6.7ms) commit transaction  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:18 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:18 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:18 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:18 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:16:27 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (88.1ms) Rendered products/new.html.erb within layouts/application (161.3ms) Completed 200 OK in 220ms (Views: 209.7ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:16:27 +0200 Served asset /application.css - 200 OK (52ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:16:27 +0200 Served asset /application.js - 200 OK (120ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 12:16:28 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 12:16:30 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:16:31 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (2.2ms) commit transaction Redirected to http://127.0.0.1:59879/products Completed 302 Found in 39ms (ActiveRecord: 4.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:16:31 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.3ms)  (1.8ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.4ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (3.1ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (14.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (32.6ms) commit transaction  (0.1ms) begin transaction SQL (1.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (47.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]] 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 10:16:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]] 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 10:16:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (2.7ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 12:16:31 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.6ms)  (279.6ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:16:31 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.5ms) Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:16:31 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]] 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 10:16:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]] 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 10:16:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:16:31 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:16:31 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.4ms)  (1.1ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:27 UTC +00:00]]  (36.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:27 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:27 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:27 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:27 UTC +00:00]]  (1.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:17:34 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (97.0ms) Rendered products/new.html.erb within layouts/application (135.7ms) Completed 200 OK in 162ms (Views: 152.4ms | ActiveRecord: 1.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:17:35 +0200 Served asset /application.css - 200 OK (35ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:17:35 +0200 Served asset /application.js - 200 OK (121ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 12:17:36 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 12:17:37 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:17:38 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (5.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]] 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 10:17:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://127.0.0.1:59955/products Completed 302 Found in 35ms (ActiveRecord: 7.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:17:38 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.3ms) 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 Rendered products/index.html.erb within layouts/application (3.9ms) Completed 200 OK in 8ms (Views: 6.0ms | ActiveRecord: 0.6ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1  (0.9ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:17:38 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.6ms) Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:17:38 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]] 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 10:17:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]] 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 10:17:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:17:38 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]] 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 10:17:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]] 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 10:17:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:17:38 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 12:17:38 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.9ms) DELETE FROM sqlite_sequence where name = 'products';  (2.7ms) DELETE FROM "product_has_categories";  (3.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (2.1ms) begin transaction SQL (33.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:04 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 12:19:04 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (13.0ms) Rendered categories/new.html.erb within layouts/application (20.5ms) Completed 200 OK in 37ms (Views: 36.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 12:19:05 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:05 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:05 UTC +00:00]]  (2.3ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 2.8ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 12:19:05 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:05 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:05 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 12:19:05 +0200 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (25.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:05 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:05 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 12:19:12 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.2ms) Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:19:12 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:19:12 +0200 Served asset /application.js - 200 OK (9ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 12:19:13 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 12:19:13 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:13 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:13 UTC +00:00]]  (67.7ms) commit transaction Redirected to http://127.0.0.1:60026/categories Completed 302 Found in 71ms (ActiveRecord: 68.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 12:19:14 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (96.8ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (0.9ms) commit transaction  (0.3ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (2.3ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:19:14 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (84.7ms) Completed 200 OK in 97ms (Views: 88.4ms | ActiveRecord: 0.7ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:19:14 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]] 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 10:19:14 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (1.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 26ms (ActiveRecord: 3.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:19:14 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (0.3ms) 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 Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.4ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]] 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 10:19:14 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]] 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 10:19:14 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:14 UTC +00:00]]  (110.2ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 12:19:15 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.4ms)  (1.4ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:15 UTC +00:00]]  (78.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:15 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:19:15 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 12:19:15 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.0ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 12:19:15 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 12:19:17 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 12:19:17 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (36.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:19:17 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 10:19:17 UTC +00:00]] 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 10:19:17 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:17 UTC +00:00]] 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 10:19:17 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 10:19:17 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:60026/products Completed 302 Found in 72ms (ActiveRecord: 40.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 12:19:17 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 49ms (Views: 3.2ms | ActiveRecord: 44.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (324.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (31.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:34:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:34:03 UTC +00:00]]  (18.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:34:03 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:34:03 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:34:03 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 10:34:03 UTC +00:00]]  (1.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 12:34:11 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (13.7ms) Rendered categories/edit.html.erb within layouts/application (19.7ms) Completed 200 OK in 70ms (Views: 66.6ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:34:11 +0200 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:34:11 +0200 Served asset /application.js - 200 OK (8ms)  (29.3ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (3.2ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (4.3ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (33.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:56:26 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:56:26 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:56:26 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:56:26 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:56:26 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 10:56:26 UTC +00:00]]  (2.5ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 12:56:37 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (11.1ms) Rendered categories/edit.html.erb within layouts/application (18.8ms) Completed 200 OK in 71ms (Views: 67.3ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:56:37 +0200 Served asset /application.css - 200 OK (9ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:56:37 +0200 Served asset /application.js - 200 OK (9ms)  (1.1ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (15.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:58:47 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:58:47 UTC +00:00]]  (8.4ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:58:47 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 10:58:47 UTC +00:00]]  (0.9ms) commit transaction  (0.2ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 10:58:47 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 10:58:47 UTC +00:00]]  (2.2ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 12:58:58 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (11.9ms) Rendered categories/edit.html.erb within layouts/application (19.5ms) Completed 200 OK in 73ms (Views: 68.6ms | ActiveRecord: 1.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 12:58:58 +0200 Served asset /application.js - 200 OK (10ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 12:58:58 +0200 Served asset /application.css - 200 OK (5ms)  (80.6ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:00:28 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:00:28 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:00:28 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:00:28 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:00:28 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:00:28 UTC +00:00]]  (1.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:00:36 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (12.0ms) Rendered categories/edit.html.erb within layouts/application (18.7ms) Completed 200 OK in 67ms (Views: 63.8ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:00:37 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:00:37 +0200 Served asset /application.js - 200 OK (9ms)  (2.5ms) DELETE FROM "categories";  (1.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:01:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:01:04 UTC +00:00]]  (2.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:01:04 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:01:04 UTC +00:00]]  (4.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:01:04 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:01:04 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:01:12 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (12.6ms) Rendered categories/edit.html.erb within layouts/application (18.3ms) Completed 200 OK in 68ms (Views: 64.6ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:01:12 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:01:12 +0200 Served asset /application.js - 200 OK (7ms)  (62.6ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (39.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:01:36 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:01:36 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:01:36 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:01:36 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:01:36 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:01:36 UTC +00:00]]  (1.2ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:01:44 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (11.4ms) Rendered categories/edit.html.erb within layouts/application (18.6ms) Completed 200 OK in 70ms (Views: 66.1ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:01:45 +0200 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:01:45 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=2" for 127.0.0.1 at 2012-10-13 13:01:52 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"2"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%2%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.3ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.5ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:03:22 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:03:22 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:03:22 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:03:22 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:03:22 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:03:22 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:03:34 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (14.1ms) Rendered categories/edit.html.erb within layouts/application (20.1ms) Completed 200 OK in 73ms (Views: 70.0ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:03:34 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:03:34 +0200 Served asset /application.js - 200 OK (11ms) Started GET "/categories/token?q=2" for 127.0.0.1 at 2012-10-13 13:03:35 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"2"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%2%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:03:36 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"3"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 3, "updated_at" = '2012-10-13 11:03:36.676864' WHERE "categories"."id" = 3  (268.8ms) commit transaction Redirected to http://127.0.0.1:61130/categories Completed 302 Found in 275ms (ActiveRecord: 269.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:03:37 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.8ms) Completed 200 OK in 48ms (Views: 46.1ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 3 LIMIT 1  (196.3ms) DELETE FROM "categories";  (4.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (177.6ms) DELETE FROM "products";  (20.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.5ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:04:03 UTC +00:00]]  (58.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:04 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:04:04 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:04 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:04:04 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:04:13 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (22.4ms) Rendered categories/edit.html.erb within layouts/application (51.9ms) Completed 200 OK in 144ms (Views: 139.9ms | ActiveRecord: 1.1ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:04:13 +0200 Served asset /application.js - 200 OK (12ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:04:13 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:04:14 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:04:15 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (9.8ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:04:15.823289' WHERE "categories"."id" = 3  (4.4ms) commit transaction Redirected to http://127.0.0.1:61168/categories Completed 302 Found in 24ms (ActiveRecord: 14.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:04:15 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.2ms) Completed 200 OK in 34ms (Views: 32.5ms | ActiveRecord: 0.2ms) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (2.5ms) DELETE FROM "product_has_categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (324.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:04:40 UTC +00:00]]  (245.4ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:04:42 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (6.5ms) Completed 200 OK in 204ms (Views: 201.8ms | ActiveRecord: 0.2ms)  (11.7ms) DELETE FROM "categories";  (18.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.5ms) DELETE FROM "products";  (3.7ms) DELETE FROM sqlite_sequence where name = 'products';  (101.0ms) DELETE FROM "product_has_categories";  (1.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00]]  (9.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:04:43 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (44.5ms) Completed 200 OK in 169ms (Views: 168.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:04:43 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00]]  (7.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 27ms (ActiveRecord: 8.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:04:43 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 6ms (Views: 3.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (26.9ms) DELETE FROM "categories";  (22.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.7ms) DELETE FROM "products";  (56.6ms) DELETE FROM sqlite_sequence where name = 'products';  (28.6ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:04:43 UTC +00:00]]  (22.0ms) commit transaction Category Load (5.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:05:00 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (6.2ms) Completed 200 OK in 13ms (Views: 9.5ms | ActiveRecord: 1.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:05:00 +0200 Served asset /application.js - 200 OK (11ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:05:00 +0200 Served asset /application.css - 200 OK (4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:05:02 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:05:02 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:05:02.857287' WHERE "categories"."id" = 3  (2.8ms) commit transaction Redirected to http://127.0.0.1:61259/categories Completed 302 Found in 10ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:05:02 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:05:03 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:05:03 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:05:03 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.3ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:05:03 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:05:04 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:04 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:05:04 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:61259/categories Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:05:04 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.2ms) begin transaction SQL (11.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00]]  (3.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:05:46 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (34.9ms) Rendered categories/new.html.erb within layouts/application (46.1ms) Completed 200 OK in 136ms (Views: 135.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:05:46 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00]]  (1.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 10ms (ActiveRecord: 2.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:05:46 +0200 Processing by CategoriesController#index as HTML Category Load (0.4ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 8ms (Views: 5.4ms | ActiveRecord: 0.4ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (15.0ms) DELETE FROM "categories";  (3.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.3ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (5.4ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00]]  (13.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (1.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:05:46 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:05:58 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (13.5ms) Completed 200 OK in 23ms (Views: 18.2ms | ActiveRecord: 1.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:05:58 +0200 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:05:58 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:05:59 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:06:00 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:06:00.666368' WHERE "categories"."id" = 3  (63.0ms) commit transaction Redirected to http://127.0.0.1:61346/categories Completed 302 Found in 68ms (ActiveRecord: 63.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:01 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (409.8ms) DELETE FROM "categories";  (463.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (30.3ms) DELETE FROM "products";  (5.8ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:03 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:06:03 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.4ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:06:04 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:06:04 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (43.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:04 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:06:04 UTC +00:00]]  (86.3ms) commit transaction Redirected to http://127.0.0.1:61346/categories Completed 302 Found in 132ms (ActiveRecord: 129.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:05 +0200 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 5ms (Views: 3.1ms | ActiveRecord: 0.3ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (221.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (22.4ms) DELETE FROM "product_has_categories";  (23.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (11.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:05 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:05 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:05 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms)  (0.8ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:05 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:05 UTC +00:00]]  (12.8ms) commit transaction  (0.1ms) begin transaction SQL (229.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:05 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:05 UTC +00:00]]  (12.3ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:06 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:06:06 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:06:06 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.6ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:06:06 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:06:06.256495' WHERE "categories"."id" = 3  (8.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 11ms (ActiveRecord: 8.6ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:06 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 37ms (Views: 36.0ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (18.4ms) begin transaction SQL (13.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:33 UTC +00:00]]  (6.7ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:33 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (6.3ms) Completed 200 OK in 107ms (Views: 100.7ms | ActiveRecord: 0.2ms)  (3.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (3.0ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (2.8ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:33 UTC +00:00]]  (15.4ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:06:33 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (29.5ms) Completed 200 OK in 96ms (Views: 95.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:06:34 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:34 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (6.5ms) DELETE FROM "categories";  (2.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.1ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00]]  (4.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:06:34 UTC +00:00]]  (12.4ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:06:40 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (6.2ms) Completed 200 OK in 12ms (Views: 9.4ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:06:40 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:06:40 +0200 Served asset /application.js - 200 OK (7ms)  (2.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.4ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:40 UTC +00:00]]  (217.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:41 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:41 UTC +00:00]]  (7.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:41 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:06:41 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:06:41 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (10.8ms) Completed 200 OK in 15ms (Views: 13.1ms | ActiveRecord: 0.5ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:06:41 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:06:41.262247' WHERE "categories"."id" = 3  (5.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 17ms (ActiveRecord: 5.9ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:41 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (6.8ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (5.7ms) DELETE FROM "products";  (1.7ms) DELETE FROM sqlite_sequence where name = 'products';  (7.6ms) DELETE FROM "product_has_categories";  (2.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (7.4ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:06:41 UTC +00:00]]  (2.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:06:41 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (5.3ms) Completed 200 OK in 9ms (Views: 8.9ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:06:42 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.4ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:06:43 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:06:43 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:06:43 UTC +00:00]]  (136.7ms) commit transaction Redirected to http://127.0.0.1:61427/categories Completed 302 Found in 141ms (ActiveRecord: 137.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:06:43 +0200 Processing by CategoriesController#index as HTML Category Load (0.4ms) SELECT "categories".* FROM "categories" Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.4ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (29.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (24.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00]]  (1.5ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:07:04 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (5.9ms) Completed 200 OK in 52ms (Views: 49.7ms | ActiveRecord: 0.2ms)  (73.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (2.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:07:04 UTC +00:00]]  (1.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:07:05 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (8.8ms) Completed 200 OK in 16ms (Views: 14.6ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:07:05 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:07:05.083486' WHERE "categories"."id" = 3  (1.5ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 2.0ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:07:05 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms) Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.4ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:05 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:05 UTC +00:00]]  (1.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:07:10 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (6.2ms) Completed 200 OK in 12ms (Views: 11.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:07:10 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:07:10 +0200 Served asset /application.js - 200 OK (10ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:07:11 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 5ms (Views: 0.3ms | ActiveRecord: 0.8ms)  (6.9ms) DELETE FROM "categories";  (44.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:14 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:14 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:14 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:14 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:14 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:07:14 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:07:14 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.6ms) Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:07:14 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:07:15 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:07:15.741056' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://127.0.0.1:61485/categories Completed 302 Found in 5ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:07:15 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:15 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:07:15 UTC +00:00]]  (34.4ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:07:15 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:07:15 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:07:15 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:07:15 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 2.0ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:07:15 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:23 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:23 UTC +00:00]]  (2.4ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:08:28 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (47.6ms) Rendered categories/new.html.erb within layouts/application (55.4ms) Completed 200 OK in 71ms (Views: 70.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:08:28 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:08:28 +0200 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:08:29 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:08:30 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00]]  (88.4ms) commit transaction Redirected to http://127.0.0.1:61606/categories Completed 302 Found in 94ms (ActiveRecord: 89.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:08:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.7ms) DELETE FROM "categories";  (3.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:08:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms)  (1.8ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:08:30 UTC +00:00]]  (1.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:08:30 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:08:31 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (1.2ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:08:32.273311' WHERE "categories"."id" = 3  (93.3ms) commit transaction Redirected to http://127.0.0.1:61606/categories Completed 302 Found in 101ms (ActiveRecord: 94.8ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.4ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.9ms) Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.2ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:08:32.657285' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:08:32 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:08:32 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (1.6ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.7ms) Completed 200 OK in 53ms (Views: 51.1ms | ActiveRecord: 0.1ms)  (1.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (1.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (16.9ms) Completed 200 OK in 48ms (Views: 47.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (2.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (1.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.9ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:15:30.823183' WHERE "categories"."id" = 3  (1.5ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7ms (ActiveRecord: 2.0ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:15:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.7ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:30 UTC +00:00]]  (1.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:15:37 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:15:37 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:15:37 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:15:38 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 4ms (Views: 0.4ms | ActiveRecord: 0.7ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:15:39 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (7.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:39 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:15:39 UTC +00:00]]  (29.0ms) commit transaction Redirected to http://127.0.0.1:61698/categories Completed 302 Found in 48ms (ActiveRecord: 36.7ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:15:39 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (940.6ms) DELETE FROM "categories";  (48.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (83.9ms) DELETE FROM "products";  (64.6ms) DELETE FROM sqlite_sequence where name = 'products';  (36.1ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:40 UTC +00:00]]  (29.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:40 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:15:40 UTC +00:00]]  (24.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:15:40 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:15:40 UTC +00:00]]  (60.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:15:41 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (6.8ms) Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 0.7ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:15:41 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:15:42 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:15:42.614262' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://127.0.0.1:61698/categories Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:15:42 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (9.4ms) Rendered categories/edit.html.erb within layouts/application (14.7ms) Completed 200 OK in 34ms (Views: 32.1ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:32:33.765584' WHERE "categories"."id" = 3  (1.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 2.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.3ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.4ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.9ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.7ms) DELETE FROM "categories";  (1.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:32:33 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms)  (1.3ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.6ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:33 UTC +00:00]]  (1.2ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:32:39 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (6.3ms) Completed 200 OK in 13ms (Views: 9.4ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:32:39 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:32:39 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:32:39 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:32:40 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:32:40.689199' WHERE "categories"."id" = 3  (142.8ms) commit transaction Redirected to http://127.0.0.1:61807/categories Completed 302 Found in 147ms (ActiveRecord: 143.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:32:41 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (185.8ms) DELETE FROM "categories";  (1.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:41 UTC +00:00]]  (1.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:32:41 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.3ms) Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:32:42 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:32:42 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (4.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:42 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:42 UTC +00:00]]  (4.1ms) commit transaction Redirected to http://127.0.0.1:61807/categories Completed 302 Found in 11ms (ActiveRecord: 8.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:32:43 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (2.4ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]] 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 11:32:53 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]] 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 11:32:53 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (2.2ms) commit transaction  (1.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (21.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (1.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:53 UTC +00:00]]  (1.3ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:32:53 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (20.7ms) Completed 200 OK in 78ms (Views: 76.8ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:32:54 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]] 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 11:32:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]] 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 11:32:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (2.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 3.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:32:54 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.7ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.9ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.8ms) DELETE FROM "product_has_categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.3ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]] 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 11:32:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]] 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 11:32:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.9ms) commit transaction  (1.6ms) DELETE FROM "categories";  (1.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (2.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.5ms) DELETE FROM "product_has_categories";  (2.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]] 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 11:32:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]] 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 11:32:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.7ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:32:54 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms)  (1.7ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (1.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:32:54 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:33:00 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (10.8ms) Completed 200 OK in 14ms (Views: 12.0ms | ActiveRecord: 1.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:33:00 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:33:00 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:33:00 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:33:02 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:33:02 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:02 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:33:02 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:33:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:02 UTC +00:00]] 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 11:33:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:02 UTC +00:00]]  (4.3ms) commit transaction Redirected to http://127.0.0.1:61879/products Completed 302 Found in 13ms (ActiveRecord: 5.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:33:02 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.3ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:45 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:45 UTC +00:00]]  (157.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:45 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:45 UTC +00:00]]  (125.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:45 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:45 UTC +00:00]]  (1.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:33:46 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (79.2ms) Rendered products/new.html.erb within layouts/application (85.4ms) Completed 200 OK in 133ms (Views: 126.5ms | ActiveRecord: 0.7ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:33:46 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]] 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 11:33:46 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]] 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 11:33:46 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]]  (27.5ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 59ms (ActiveRecord: 29.0ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:33:46 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (6.7ms) Completed 200 OK in 11ms (Views: 9.0ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (33.9ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.1ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]]  (24.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]]  (5.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]]  (1.5ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]] 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 11:33:46 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]] 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 11:33:46 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:46 UTC +00:00]]  (8.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:33:55 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.3ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (13.6ms) Completed 200 OK in 21ms (Views: 16.7ms | ActiveRecord: 1.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:33:55 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:33:55 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:33:56 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:33:57 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:33:58 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:61941/products Completed 302 Found in 24ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:33:58 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:33:58 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:33:58 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.0ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:33:59 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:34:00 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:34:01 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]] 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 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (4.6ms) commit transaction Redirected to http://127.0.0.1:61941/products Completed 302 Found in 14ms (ActiveRecord: 6.0ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:34:01 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (3.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]] 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 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]] 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 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:34:01 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.4ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]] 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 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]] 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 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (1.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:34:01 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.7ms) Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:34:01 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:34:01 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:34:01 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00]]  (2.4ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00]]  (1.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00]] 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 11:35:55 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00]] 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 11:35:55 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:35:55 UTC +00:00]]  (1.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:36:01 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (60.1ms) Rendered products/edit.html.erb within layouts/application (67.0ms) Completed 200 OK in 87ms (Views: 80.2ms | ActiveRecord: 1.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:36:02 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:36:02 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:36:02 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:36:04 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:36:04 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:36:04 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:04 UTC +00:00]]  (2.1ms) commit transaction Redirected to http://127.0.0.1:62056/products Completed 302 Found in 15ms (ActiveRecord: 3.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:36:04 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:04 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:05 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:05 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:36:05 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.5ms) Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:36:05 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:36:06 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:36:07 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]] 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 11:36:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]] 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 11:36:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:62056/products Completed 302 Found in 14ms (ActiveRecord: 5.5ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:36:07 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]] 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 11:36:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]] 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 11:36:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:07 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:36:07 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms)  (118.4ms) DELETE FROM "categories";  (375.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (625.1ms) DELETE FROM "products";  (509.8ms) DELETE FROM sqlite_sequence where name = 'products';  (132.6ms) DELETE FROM "product_has_categories";  (7.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:09 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:09 UTC +00:00]]  (467.2ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00]]  (364.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00]]  (2.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00]] 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 11:36:10 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00]] 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 11:36:10 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:10 UTC +00:00]]  (395.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:36:11 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.7ms) Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:36:11 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:36:11 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]]  (9.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 16ms (ActiveRecord: 10.7ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:36:11 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (15.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (22.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]]  (1.4ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:36:11 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.2ms) Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:36:11 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]] 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 11:36:11 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:36:11 UTC +00:00]]  (341.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 348ms (ActiveRecord: 342.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:36:11 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (20.6ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (8.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:56 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:56 UTC +00:00]]  (14.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:56 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:56 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:56 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:56 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]] 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 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.5ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (28.3ms) Completed 200 OK in 98ms (Views: 96.2ms | ActiveRecord: 0.5ms)  (2.8ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (4.8ms) DELETE FROM sqlite_sequence where name = 'products';  (1.5ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (3.8ms) commit transaction  (0.1ms) begin transaction SQL (3.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (3.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (16.1ms) Completed 200 OK in 27ms (Views: 25.7ms | ActiveRecord: 0.4ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]] 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 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 15ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (0.5ms) 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 Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.7ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (4.2ms) DELETE FROM "categories";  (1.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (3.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (8.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]] 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 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]] 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 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (4.5ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.3ms) 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  (0.3ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (20.6ms) Completed 200 OK in 27ms (Views: 24.2ms | ActiveRecord: 1.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (7.6ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 83ms (ActiveRecord: 9.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:37:57 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 9ms (Views: 7.2ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.8ms) DELETE FROM "categories";  (1.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (3.9ms) DELETE FROM "products";  (1.9ms) DELETE FROM sqlite_sequence where name = 'products';  (2.6ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.1ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:37:57 UTC +00:00]]  (2.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:38:05 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (9.4ms) Completed 200 OK in 12ms (Views: 10.6ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:38:05 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:38:05 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:38:06 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:38:07 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:38:08 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]] SQL (0.7ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]]  (5.3ms) commit transaction Redirected to http://127.0.0.1:62174/products Completed 302 Found in 17ms (ActiveRecord: 7.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:38:08 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.4ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]] 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 11:38:08 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]] 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 11:38:08 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:38:08 UTC +00:00]]  (1.5ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:38:08 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (8.1ms) Completed 200 OK in 11ms (Views: 9.1ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:38:08 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:38:10 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:38:10 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:38:10 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:38:10 UTC +00:00]]  (91.8ms) commit transaction Redirected to http://127.0.0.1:62174/products Completed 302 Found in 102ms (ActiveRecord: 93.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:38:11 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (7.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00]]  (6.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00]]  (4.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:04 UTC +00:00]]  (2.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:05 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (31.4ms) Completed 200 OK in 222ms (Views: 218.9ms | ActiveRecord: 0.4ms)  (21.5ms) DELETE FROM "categories";  (4.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.0ms) DELETE FROM "products";  (2.8ms) DELETE FROM sqlite_sequence where name = 'products';  (13.0ms) DELETE FROM "product_has_categories";  (10.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:05 UTC +00:00]]  (9.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:05 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:05 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:39:11 +0200 Processing by ProductsController#new as HTML  (0.3ms) 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  (0.2ms) 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 Rendered products/_form.html.erb (26.4ms) Completed 200 OK in 45ms (Views: 42.3ms | ActiveRecord: 1.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:39:11 +0200 Served asset /application.js - 200 OK (17ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:39:11 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:39:12 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:39:13 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:39:14 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:14 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:39:14 UTC +00:00]] 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 11:39:14 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:14 UTC +00:00]] 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 11:39:14 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:14 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:62277/products Completed 302 Found in 13ms (ActiveRecord: 2.7ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:14 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.4ms) Product Load (0.3ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (5.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (3.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (5.4ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (4.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (5.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]] 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 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (23.3ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.3ms) 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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (23.6ms) Completed 200 OK in 36ms (Views: 33.1ms | ActiveRecord: 1.0ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (4.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (3.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (4.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 57ms (ActiveRecord: 13.5ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.4ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.0ms) DELETE FROM "products";  (1.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (3.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (1.8ms) commit transaction  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (1.5ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#new as HTML  (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  (0.5ms) 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 Rendered products/_form.html.erb (9.5ms) Completed 200 OK in 12ms (Views: 11.2ms | ActiveRecord: 0.7ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (1.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]] 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 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (1.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 26ms (ActiveRecord: 3.6ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#index as HTML Product Load (0.3ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (2.2ms) DELETE FROM "categories";  (5.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (5.6ms) DELETE FROM "products";  (5.4ms) DELETE FROM sqlite_sequence where name = 'products';  (3.7ms) DELETE FROM "product_has_categories";  (3.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (0.9ms) commit transaction  (3.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (1.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]] 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 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]] 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 11:39:15 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:15 UTC +00:00]]  (4.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:39:15 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (68.5ms) Completed 200 OK in 73ms (Views: 70.6ms | ActiveRecord: 0.9ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:39:16 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:39:17 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:39:18 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.7ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (5.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:39:18 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:18 UTC +00:00]]  (108.6ms) commit transaction Redirected to http://127.0.0.1:62277/products Completed 302 Found in 124ms (ActiveRecord: 115.3ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:18 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (281.3ms) DELETE FROM "categories";  (4.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (20.2ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (14.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00]]  (2.0ms) commit transaction  (0.1ms) begin transaction SQL (1.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00]]  (7.3ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00]] SQL (2.9ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:41 UTC +00:00]]  (1.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:39:48 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (59.9ms) Rendered products/edit.html.erb within layouts/application (66.6ms) Completed 200 OK in 85ms (Views: 80.8ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:39:48 +0200 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:39:48 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:39:48 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:39:50 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:39:50 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:39:50 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:50 UTC +00:00]]  (2.1ms) commit transaction Redirected to http://127.0.0.1:62390/products Completed 302 Found in 16ms (ActiveRecord: 3.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:50 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.3ms) Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:39:51 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.3ms) Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:39:51 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]] 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 11:39:51 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]] 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 11:39:51 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (2.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 3.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:51 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.4ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.4ms) DELETE FROM "products";  (1.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (1.4ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:51 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:39:51 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (6.5ms) Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:39:51 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:39:53 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:39:53 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:53 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:39:53 UTC +00:00]] 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 11:39:53 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:53 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:39:53 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:53 UTC +00:00]]  (8.7ms) commit transaction Redirected to http://127.0.0.1:62390/products Completed 302 Found in 18ms (ActiveRecord: 10.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:53 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1  (1.2ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]] 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 11:39:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]] 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 11:39:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (1.5ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:39:54 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (7.1ms) Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.7ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:39:54 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:39:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:54 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]] 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 11:39:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]] 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 11:39:54 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:39:54 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:39:54 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms)  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (31.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00]]  (3.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (1.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00]]  (2.5ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00]] 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 11:40:29 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:29 UTC +00:00]]  (1.5ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:40:35 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (60.3ms) Rendered products/edit.html.erb within layouts/application (66.7ms) Completed 200 OK in 84ms (Views: 79.4ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:40:36 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:40:36 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:40:36 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:40:37 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:40:38 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:40:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:62508/products Completed 302 Found in 16ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:40:38 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]] 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 11:40:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]] 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 11:40:38 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:38 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.0ms) Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:40:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 3.0ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.6ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (2.4ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]] 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 11:40:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]] 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 11:40:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (2.3ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (6.3ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]] 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 11:40:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]] 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 11:40:39 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 2.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:40:39 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:40:39 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.1ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:40:40 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:40:41 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:40:42 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:40:42 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:40:42 UTC +00:00]] 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 11:40:42 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:42 UTC +00:00]] 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 11:40:42 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:40:42 UTC +00:00]]  (305.9ms) commit transaction Redirected to http://127.0.0.1:62508/products Completed 302 Found in 315ms (ActiveRecord: 307.3ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:40:42 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (231.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (140.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:36 UTC +00:00]]  (60.4ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00]]  (2.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00]] 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 11:42:37 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00]] 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 11:42:37 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:42:37 UTC +00:00]]  (1.4ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:42:42 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (56.8ms) Rendered products/edit.html.erb within layouts/application (63.6ms) Completed 200 OK in 83ms (Views: 78.1ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:42:42 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:42:42 +0200 Served asset /application.js - 200 OK (9ms)  (1.7ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:45 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:45 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:45 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:45 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:45 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:45 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:42:45 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.1ms) Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.3ms)  (1.8ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]] 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 11:42:47 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]] 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 11:42:47 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:42:47 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.9ms) Completed 200 OK in 10ms (Views: 8.6ms | ActiveRecord: 0.6ms)  (1.6ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:42:47 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.7ms) Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]] 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 11:42:47 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]] 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 11:42:47 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:42:47 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:42:47 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 6ms (Views: 4.8ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (2.2ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (30.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00]]  (9.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00]]  (4.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00]]  (7.1ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00]] 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 11:43:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:33 UTC +00:00]]  (3.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:43:34 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (23.8ms) Completed 200 OK in 99ms (Views: 96.9ms | ActiveRecord: 0.4ms)  (86.2ms) DELETE FROM "categories";  (7.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (3.6ms) DELETE FROM "products";  (5.9ms) DELETE FROM sqlite_sequence where name = 'products';  (13.2ms) DELETE FROM "product_has_categories";  (10.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:34 UTC +00:00]]  (1.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:34 UTC +00:00]]  (10.5ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:34 UTC +00:00]]  (2.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:43:41 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (18.2ms) Completed 200 OK in 27ms (Views: 25.5ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:43:41 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:43:41 +0200 Served asset /application.js - 200 OK (6ms)  (255.4ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.9ms) DELETE FROM "products";  (2.1ms) DELETE FROM sqlite_sequence where name = 'products';  (2.2ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:43:44 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (7.1ms) Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.4ms)  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.4ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]] 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 11:43:44 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]] 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 11:43:44 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.5ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:43:44 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (8.3ms) Completed 200 OK in 13ms (Views: 10.4ms | ActiveRecord: 0.7ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:43:44 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (2.3ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 13ms (ActiveRecord: 3.3ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:43:44 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.4ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]] 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 11:43:44 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]] 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 11:43:44 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:44 UTC +00:00]]  (1.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:43:44 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.3ms) 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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (9.9ms) Completed 200 OK in 15ms (Views: 11.6ms | ActiveRecord: 1.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:43:45 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:43:46 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:43:47 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:43:47 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:43:47 UTC +00:00]]  (3.5ms) commit transaction Redirected to http://127.0.0.1:62804/products Completed 302 Found in 12ms (ActiveRecord: 4.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:43:47 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (275.5ms) DELETE FROM "categories";  (167.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (109.6ms) DELETE FROM "products";  (1.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (2.4ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]] 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 11:46:32 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.6ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:46:32 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (14.3ms) Completed 200 OK in 55ms (Views: 53.9ms | ActiveRecord: 0.3ms)  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:46:32 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (10.6ms) Completed 200 OK in 17ms (Views: 15.8ms | ActiveRecord: 0.4ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:46:32 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]] 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 11:46:32 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]] 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 11:46:32 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.8ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:46:32 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.8ms) DELETE FROM "product_has_categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.4ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.3ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:32 UTC +00:00]]  (1.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:46:38 +0200 Processing by ProductsController#new as HTML  (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  (0.8ms) 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 Rendered products/_form.html.erb (14.1ms) Completed 200 OK in 17ms (Views: 14.9ms | ActiveRecord: 1.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:46:38 +0200 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:46:38 +0200 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:46:39 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:46:40 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:46:41 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]] SQL (0.6ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]] 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 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:62947/products Completed 302 Found in 14ms (ActiveRecord: 5.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:46:41 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.2ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]] 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 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]] 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 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:46:41 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (7.3ms) Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.8ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:46:41 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 13ms (ActiveRecord: 2.5ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:46:41 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]] 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 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]] 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 11:46:41 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:41 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:46:41 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.2ms) Completed 200 OK in 9ms (Views: 7.2ms | ActiveRecord: 0.7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:46:42 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:46:43 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:46:44 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 11:46:44 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:46:44 UTC +00:00]]  (8.9ms) commit transaction Redirected to http://127.0.0.1:62947/products Completed 302 Found in 19ms (ActiveRecord: 10.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:46:44 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (29.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00]]  (2.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00]]  (1.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00]] 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 11:47:25 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:25 UTC +00:00]]  (2.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:47:30 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (60.3ms) Rendered products/edit.html.erb within layouts/application (68.7ms) Completed 200 OK in 88ms (Views: 82.8ms | ActiveRecord: 1.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-13 13:47:30 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-13 13:47:30 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-13 13:47:31 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:47:32 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:47:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:63054/products Completed 302 Found in 17ms (ActiveRecord: 2.6ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (3.4ms) Completed 200 OK in 8ms (Views: 6.0ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.3ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.1ms) Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]] 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 11:47:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]] 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 11:47:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.2ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]] 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 11:47:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]] 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 11:47:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (10.9ms) Completed 200 OK in 14ms (Views: 12.3ms | ActiveRecord: 0.9ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 11:47:33 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:33 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 12ms (ActiveRecord: 2.8ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:47:33 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:34 UTC +00:00]]  (3.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:34 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:34 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-13 13:47:34 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (6.3ms) Completed 200 OK in 9ms (Views: 8.1ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-13 13:47:34 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-13 13:47:35 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-13 13:47:36 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:36 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 11:47:36 UTC +00:00]] 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 11:47:36 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:36 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 11:47:36 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:36 UTC +00:00]]  (7.9ms) commit transaction Redirected to http://127.0.0.1:63054/products Completed 302 Found in 17ms (ActiveRecord: 9.5ms) Started GET "/products" for 127.0.0.1 at 2012-10-13 13:47:37 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.4ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (2.3ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]] 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 11:47:37 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]] 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 11:47:37 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-13 13:47:37 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.4ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (1.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:37 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:47:37 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (8.2ms) Completed 200 OK in 15ms (Views: 12.7ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-13 13:47:38 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:47:38 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (271.7ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:47:38.886296' WHERE "categories"."id" = 3  (70.8ms) commit transaction Redirected to http://127.0.0.1:63054/categories Completed 302 Found in 347ms (ActiveRecord: 342.7ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:47:39 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 6ms (Views: 4.8ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (38.9ms) DELETE FROM "categories";  (568.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.5ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (145.0ms) DELETE FROM "product_has_categories";  (244.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:47:40 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.5ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:47:40 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:47:40 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (247.7ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-13 13:47:40 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.6ms) Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-13 13:47:40 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 11:47:40.904379' WHERE "categories"."id" = 3  (1.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:47:40 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.7ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:40 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-13 13:47:41 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.2ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-13 13:47:42 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-13 13:47:43 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:43 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 11:47:43 UTC +00:00]]  (1.9ms) commit transaction Redirected to http://127.0.0.1:63054/categories Completed 302 Found in 6ms (ActiveRecord: 2.6ms) Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:47:43 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (27.1ms) DELETE FROM "categories";  (7.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (30.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 11:47:43 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 11:47:43 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-13 13:47:43 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (22.4ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (7.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:52 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:52 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:52 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:52 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:52 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:52 UTC +00:00]]  (1.0ms) commit transaction  (0.8ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (22.9ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (11.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (3.2ms) commit transaction  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (2.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:12:53 +0200 Processing by ItemsController#new as HTML Completed 500 Internal Server Error in 2ms  (1.2ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (3.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (1.1ms) commit transaction  (2.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (1.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (7.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:12:53 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:13:02 +0200 Processing by ItemsController#new as HTML Completed 500 Internal Server Error in 1ms  (2.2ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:04 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:04 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:04 UTC +00:00]]  (1.0ms) commit transaction  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Connecting to database specified by database.yml  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Migrating to CreateCategories (20121012100526) Migrating to CreateProducts (20121012235444) Migrating to CreateProductHasCategories (20121012235509) Migrating to CreateItems (20121013214019)  (0.0ms) select sqlite_version(*)  (0.0ms) begin transaction  (0.4ms) CREATE TABLE "items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "category_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121013214019')  (2.3ms) commit transaction  (0.3ms) select sqlite_version(*)  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  (0.0ms) PRAGMA index_list("categories")  (0.0ms) PRAGMA index_list("items")  (0.0ms) PRAGMA index_list("product_has_categories")  (0.0ms) PRAGMA index_list("products") Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:21 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:21 UTC +00:00]]  (2.3ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:21 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:21 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:21 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:21 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:13:23 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (67.4ms) Rendered items/new.html.erb within layouts/application (72.5ms) Completed 200 OK in 121ms (Views: 113.9ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 00:13:24 +0200 Compiled token-input-facebook.css (0ms) (pid 17853) Compiled application.css (7ms) (pid 17853) Served asset /application.css - 200 OK (15ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 00:13:24 +0200 Compiled jquery.js (4ms) (pid 17853) Compiled jquery_ujs.js (0ms) (pid 17853) Compiled jquery.tokeninput.js (26ms) (pid 17853) Compiled application.js (44ms) (pid 17853) Served asset /application.js - 200 OK (53ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:13:24 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:13:25 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://127.0.0.1:52870/items Completed 302 Found in 8ms (ActiveRecord: 2.2ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:13:25 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:13:25 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.7ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:13:25 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:13:25 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.8ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:13:25 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (15.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.2ms) commit transaction  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.0ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:26 UTC +00:00]]  (1.0ms) commit transaction  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00]]  (2.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:13:59 UTC +00:00]]  (1.3ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 00:13:59 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (28.6ms) Completed 200 OK in 39ms (Views: 37.7ms | ActiveRecord: 0.2ms)  (1.8ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:00 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:00 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:00 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:00 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:00 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:00 UTC +00:00]]  (1.4ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:14:03 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (85.7ms) Completed 200 OK in 95ms (Views: 94.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 00:14:03 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 00:14:03 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:14:03 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:14:04 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (1.4ms) commit transaction Redirected to http://127.0.0.1:52937/items Completed 302 Found in 5ms (ActiveRecord: 2.1ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:04 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.4ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:14:04 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.9ms) Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:14:04 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (1.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 2.1ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:04 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.5ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:04 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00]]  (1.6ms) commit transaction  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00]]  (1.4ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:14:05 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:14:05 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.1ms) Completed 200 OK in 9ms (Views: 7.2ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 00:14:05 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:14:06 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:14:06.454102' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://127.0.0.1:52937/items Completed 302 Found in 6ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:06 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms) Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00]]  (2.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:14:25 UTC +00:00]]  (1.2ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:14:29 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (63.4ms) Rendered items/edit.html.erb within layouts/application (70.4ms) Completed 200 OK in 85ms (Views: 82.2ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 00:14:29 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 00:14:29 +0200 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 00:14:30 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:14:31 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:14:31.234759' WHERE "items"."id" = 1  (116.3ms) commit transaction Redirected to http://127.0.0.1:53017/items Completed 302 Found in 122ms (ActiveRecord: 116.9ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#index as HTML Item Load (0.4ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 7ms (Views: 4.3ms | ActiveRecord: 0.4ms) Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (33.4ms) DELETE FROM "categories";  (2.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.9ms) Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 2.3ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.7ms) commit transaction  (0.3ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (4.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.0ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:14:32.447777' WHERE "items"."id" = 1  (1.4ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.8ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:32 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:14:32 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.9ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:14:33 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:14:33 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:33 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:14:33 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:53017/items Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:33 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.4ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:14:34 UTC +00:00]]  (1.2ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 00:14:34 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms)  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (2.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (2.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 00:19:19 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (28.5ms) Completed 200 OK in 39ms (Views: 37.9ms | ActiveRecord: 0.2ms)  (1.4ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:19:19 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (99.7ms) Completed 500 Internal Server Error in 104ms  (1.9ms) DELETE FROM "categories";  (2.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (2.1ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:19 UTC +00:00]]  (1.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:19:23 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (25.3ms) Completed 500 Internal Server Error in 27ms  (2.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:19:25 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:19:26 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (48.6ms) Completed 500 Internal Server Error in 52ms  (1.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:19:26 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:19:26 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (21.9ms) Completed 500 Internal Server Error in 24ms  (2.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:51 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:51 UTC +00:00]]  (2.2ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:20:51 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.8ms) Completed 200 OK in 42ms (Views: 40.4ms | ActiveRecord: 0.1ms)  (1.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:51 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:51 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 00:20:55 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (19.2ms) Completed 200 OK in 66ms (Views: 65.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 00:20:55 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 00:20:55 +0200 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-14 00:20:56 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 00:20:56 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:56 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:20:56 UTC +00:00]]  (60.7ms) commit transaction Redirected to http://127.0.0.1:53294/categories Completed 302 Found in 64ms (ActiveRecord: 61.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (1.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.0ms) Completed 200 OK in 49ms (Views: 47.2ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 22:20:57.336934' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:20:57 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 00:20:57 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (5.8ms) Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-14 00:20:58 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 00:20:58 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 22:20:58.872293' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://127.0.0.1:53294/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:20:58 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]] 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 22:20:59 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (1.6ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-14 00:20:59 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 18ms (Views: 16.7ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (1.3ms) commit transaction  (28.8ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (1.4ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:20:59 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 00:20:59 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (7.9ms) Completed 200 OK in 20ms (Views: 10.2ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:20:59 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-14 00:21:01 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 00:21:01 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:01 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:21:01 UTC +00:00]] 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 22:21:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:01 UTC +00:00]] 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 22:21:01 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:01 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:53294/products Completed 302 Found in 11ms (ActiveRecord: 2.7ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:21:01 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.4ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (6.5ms) Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.4ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]] 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]] 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.3ms) 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 Completed 200 OK in 7ms (Views: 5.2ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.5ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]] 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]] 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.3ms) 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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (9.0ms) Completed 200 OK in 13ms (Views: 11.1ms | ActiveRecord: 1.0ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 27ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]] 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]] 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 22:21:02 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:02 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 00:21:02 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (8.0ms) Completed 200 OK in 12ms (Views: 9.4ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 00:21:03 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:21:06 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 00:21:07 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.5ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00]]  (1.6ms) commit transaction Redirected to http://127.0.0.1:53294/products Completed 302 Found in 49ms (ActiveRecord: 3.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:21:07 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.4ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00]]  (2.2ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:07 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00]]  (1.2ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 00:21:08 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:08 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:21:08 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (76.6ms) Completed 200 OK in 81ms (Views: 80.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:21:10 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:21:11 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00]]  (24.6ms) commit transaction Redirected to http://127.0.0.1:53294/items Completed 302 Found in 28ms (ActiveRecord: 25.2ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:21:11 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (17.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (14.2ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (9.3ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:21:11 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.9ms) Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:21:11 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:21:11 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.9ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:21:11 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (2.1ms) DELETE FROM "items";  (20.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:21:12 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (7.5ms) Completed 200 OK in 12ms (Views: 10.3ms | ActiveRecord: 0.5ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:21:12 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:21:12.197596' WHERE "items"."id" = 1  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:21:12 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (23.5ms) DELETE FROM "categories";  (7.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (25.4ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (8.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (20.2ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:21:12 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:21:12 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (8.2ms) Completed 200 OK in 12ms (Views: 10.6ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 00:21:13 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:21:14 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:21:14.802393' WHERE "items"."id" = 1  (0.8ms) commit transaction Redirected to http://127.0.0.1:53294/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:21:14 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.5ms) DELETE FROM "categories";  (4.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.2ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (1.6ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:16 UTC +00:00]]  (2.3ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:16 UTC +00:00]]  (1.3ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:16 UTC +00:00]]  (1.3ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:52:17 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (85.2ms) Rendered items/new.html.erb within layouts/application (89.7ms) Completed 200 OK in 153ms (Views: 146.8ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:52:17 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00]]  (152.4ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 156ms (ActiveRecord: 152.9ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:52:17 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (165.0ms) DELETE FROM "categories";  (105.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:52:17 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:52:21 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (9.6ms) Completed 200 OK in 18ms (Views: 13.3ms | ActiveRecord: 1.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 00:52:21 +0200 Served asset /application.css - 200 OK (41ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 00:52:21 +0200 Served asset /application.js - 200 OK (29ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 00:52:22 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:52:23.072513' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://127.0.0.1:54365/items Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (105.0ms) DELETE FROM "categories";  (115.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (28.8ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.4ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.1ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.6ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "item"], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.4ms) Completed 200 OK in 8ms (Views: 6.7ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.2ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 22:52:23.603118' WHERE "items"."id" = 1  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:23 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 00:52:23 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.5ms) Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:52:24 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 00:52:25 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:54365/items Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 00:52:25 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (4.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (34.6ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (50.0ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00]]  (1.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 00:52:25 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.8ms) Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 00:52:25 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:52:25 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (30.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:25 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 00:52:25 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.6ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-14 00:52:26 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 00:52:26 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 22:52:26.844819' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://127.0.0.1:54365/categories Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:52:26 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.1ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:26 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:26 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:52:26 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms)  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 00:52:27 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.7ms) Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 00:52:27 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.2ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 22:52:27.067993' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:52:27 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:27 UTC +00:00]]  (1.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 00:52:27 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-14 00:52:27 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 00:52:28 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://127.0.0.1:54365/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 00:52:28 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 00:52:28 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (99.3ms) Completed 200 OK in 108ms (Views: 102.1ms | ActiveRecord: 0.6ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 00:52:28 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]] 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 22:52:28 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (1.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 19ms (ActiveRecord: 2.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:52:28 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (1.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]] 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 22:52:28 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]] 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 22:52:28 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:28 UTC +00:00]]  (1.4ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 00:52:28 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.7ms) Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 00:52:29 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:52:30 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://127.0.0.1:54365/products Completed 302 Found in 15ms (ActiveRecord: 2.6ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "new one"], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]] 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 22:52:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]] 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 22:52:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "product"], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]] 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 22:52:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]] 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 22:52:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (6.0ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Sat, 13 Oct 2012 22:52:31 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 00:52:31 +0200 Processing by ProductsController#new as HTML  (0.3ms) 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  (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 Rendered products/_form.html.erb (7.1ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 00:52:32 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-14 00:52:34 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 00:52:34 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 13 Oct 2012 22:52:34 UTC +00:00], ["name", "hello"], ["updated_at", Sat, 13 Oct 2012 22:52:34 UTC +00:00]] 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 22:52:34 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:34 UTC +00:00]] 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 22:52:34 UTC +00:00], ["product_id", 1], ["updated_at", Sat, 13 Oct 2012 22:52:34 UTC +00:00]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:54365/products Completed 302 Found in 11ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 00:52:34 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.2ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.0ms) begin transaction 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]]  (1.0ms) commit transaction  (0.0ms) begin transaction 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]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:39:29 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (9.0ms) Rendered categories/edit.html.erb within layouts/application (13.6ms) Completed 200 OK in 24ms (Views: 22.8ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:39:30 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:39:30.085163' WHERE "categories"."id" = 3  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:39:30 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:39:30 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:30 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:39:32 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (7.2ms) Completed 200 OK in 13ms (Views: 9.8ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 01:39:32 +0200 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 01:39:32 +0200 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-14 01:39:33 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:39:34 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:39:34.424859' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://127.0.0.1:56775/categories Completed 302 Found in 5ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:34 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.6ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (1.5ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.5ms) DELETE FROM "items";  (1.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (65.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:39:34 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-14 01:39:35 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:56775/categories Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.7ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (65.6ms) Completed 200 OK in 72ms (Views: 70.1ms | ActiveRecord: 0.4ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.2ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:39:36.338070' WHERE "items"."id" = 1  (1.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 2.2ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.0ms) begin transaction 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]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.7ms) Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 2.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.0ms) begin transaction 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]]  (0.8ms) commit transaction  (0.0ms) begin transaction 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]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:39:36 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.9ms) Completed 200 OK in 8ms (Views: 6.1ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:39:37 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:39:37 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:39:37.953972' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://127.0.0.1:56775/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:37 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.3ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:39:38 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.9ms) Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:39:38 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:56775/items Completed 302 Found in 3ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.4ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms)  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.0ms) begin transaction 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]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (15.8ms) Completed 200 OK in 20ms (Views: 18.4ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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]]  (1.6ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.5ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.3ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.0ms) begin transaction 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]]  (1.1ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.3ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:39 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.0ms) begin transaction 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]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:39:40 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.0ms) Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:39:40 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:39:41 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:39:42 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:56775/products Completed 302 Found in 9ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:42 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.4ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:39:42 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.5ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:39:43 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-14 01:39:44 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 01:39:45 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction 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]] 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]] 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]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:56775/products Completed 302 Found in 10ms (ActiveRecord: 2.7ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:45 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (1.5ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.0ms) begin transaction 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]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-14 01:39:45 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:47:09 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (10.6ms) Rendered categories/edit.html.erb within layouts/application (46.6ms) Completed 200 OK in 62ms (Views: 59.2ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-14 01:47:10 +0200 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-14 01:47:10 +0200 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-14 01:47:10 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:47:11 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:47:11.535973' WHERE "categories"."id" = 3  (0.5ms) commit transaction Redirected to http://127.0.0.1:57074/categories Completed 302 Found in 7ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.2ms) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (55.5ms) DELETE FROM "categories";  (2.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.8ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.1ms)  (1.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:47:11 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction 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]]  (1.4ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.9ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:11 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-14 01:47:12 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.0ms) Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-14 01:47:12 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-14 01:47:13 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:57074/categories Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:13 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction  (0.0ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-14 01:47:13 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-14 01:47:13 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.2ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-13 23:47:13.590811' WHERE "categories"."id" = 3  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2012-10-14 01:47:13 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.7ms) commit transaction  (0.0ms) begin transaction 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]]  (1.3ms) commit transaction  (0.0ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:47:13 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (63.4ms) Completed 200 OK in 68ms (Views: 66.1ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:47:14 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:47:15.138499' WHERE "items"."id" = 1  (0.9ms) commit transaction Redirected to http://127.0.0.1:57074/items Completed 302 Found in 6ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.1ms) Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.0ms) begin transaction 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]]  (0.9ms) commit transaction  (0.0ms) begin transaction 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]]  (1.9ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms)  (1.2ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.7ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.3ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 2.0ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.7ms) commit transaction  (0.0ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-14 01:47:15 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.6ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:47:16 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-14 01:47:16 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:57074/items Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:16 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.4ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.0ms) begin transaction 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]]  (1.0ms) commit transaction  (0.0ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-14 01:47:16 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.8ms) Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-14 01:47:17 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-13 23:47:17.010915' WHERE "items"."id" = 1  (1.1ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-14 01:47:17 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.7ms) commit transaction  (0.0ms) begin transaction 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]]  (0.7ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:47:17 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (18.4ms) Completed 200 OK in 23ms (Views: 20.8ms | ActiveRecord: 1.0ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-14 01:47:17 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:47:19 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:47:19 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:57074/products Completed 302 Found in 14ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:19 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction 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]] 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]] 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]]  (1.2ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:20 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:47:20 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.6ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 01:47:20 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:20 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (1.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-14 01:47:20 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (6.0ms) Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-14 01:47:20 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-14 01:47:22 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2012-10-14 01:47:23 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction 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]] 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]] 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]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:57074/products Completed 302 Found in 11ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:23 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction 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]] 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]] 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]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-14 01:47:23 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.4ms) Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-14 01:47:23 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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]]  (1.6ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2012-10-14 01:47:23 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.0ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-24 16:49:19 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (143.2ms) Rendered categories/edit.html.erb within layouts/application (159.9ms) Completed 200 OK in 202ms (Views: 200.3ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-24 16:49:19 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-24 14:49:19.576089' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:19 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (67.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (11.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2012-10-24 16:49:27 +0200 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (9.0ms) Completed 200 OK in 16ms (Views: 12.6ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2012-10-24 16:49:27 +0200 Served asset /application.css - 200 OK (42ms) Started GET "/assets/application.js" for 127.0.0.1 at 2012-10-24 16:49:27 +0200 Served asset /application.js - 200 OK (15ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2012-10-24 16:49:28 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2012-10-24 16:49:29 +0200 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2012-10-24 14:49:29.265141' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://127.0.0.1:51454/categories Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:29 +0200 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.3ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (113.9ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (128.3ms) DELETE FROM sqlite_sequence where name = 'products';  (4.6ms) DELETE FROM "product_has_categories";  (1.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (2.6ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (167.3ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:29 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms)  (1.9ms) DELETE FROM "categories";  (9.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (12.7ms) DELETE FROM "products";  (9.1ms) DELETE FROM sqlite_sequence where name = 'products';  (60.1ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (92.2ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-24 16:49:30 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 36ms (Views: 35.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2012-10-24 16:49:30 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction 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]]  (3.9ms) commit transaction Redirected to http://127.0.0.1:51454/categories Completed 302 Found in 11ms (ActiveRecord: 7.6ms) Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2012-10-24 16:49:31 +0200 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2012-10-24 16:49:31 +0200 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (2.1ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-24 16:49:31 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (81.0ms) Completed 200 OK in 134ms (Views: 131.9ms | ActiveRecord: 0.4ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-24 16:49:32 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-24 14:49:32.038199' WHERE "items"."id" = 1  (1.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 2.1ms) Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:32 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 44ms (Views: 42.7ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (1.3ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2012-10-24 16:49:32 +0200 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (7.5ms) Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 0.7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-24 16:49:32 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started PUT "/items/1" for 127.0.0.1 at 2012-10-24 16:49:33 +0200 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (2.6ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2012-10-24 14:49:33.550999' WHERE "items"."id" = 1  (3.8ms) commit transaction Redirected to http://127.0.0.1:51454/items Completed 302 Found in 10ms (ActiveRecord: 6.5ms) Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:33 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.7ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.0ms) begin transaction 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]]  (1.0ms) commit transaction Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:33 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.1ms)  (1.3ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.1ms) commit transaction  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-24 16:49:33 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.0ms) Completed 200 OK in 62ms (Views: 61.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-24 16:49:34 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction 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]]  (250.7ms) commit transaction Redirected to http://127.0.0.1:51454/items Completed 302 Found in 254ms (ActiveRecord: 251.3ms) Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.4ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2012-10-24 16:49:35 +0200 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.4ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2012-10-24 16:49:35 +0200 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.4ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction 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]] 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]] 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]]  (1.3ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-24 16:49:36 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (18.5ms) Completed 200 OK in 55ms (Views: 52.7ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-24 16:49:36 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:36 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 33ms (Views: 31.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (1.0ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction  (0.1ms) begin transaction 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]]  (1.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction 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]] 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]] 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]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2012-10-24 16:49:36 +0200 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.5ms) Completed 200 OK in 10ms (Views: 7.6ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2012-10-24 16:49:36 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-24 16:49:38 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2012-10-24 16:49:38 +0200 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 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]]  (8.0ms) commit transaction Redirected to http://127.0.0.1:51454/products Completed 302 Found in 15ms (ActiveRecord: 9.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:39 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction 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]] 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]] 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]]  (1.1ms) commit transaction Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:39 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.9ms) commit transaction  (0.1ms) begin transaction 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]]  (1.4ms) commit transaction  (0.1ms) begin transaction 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]]  (1.5ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-24 16:49:39 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.2ms) Completed 200 OK in 36ms (Views: 35.6ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2012-10-24 16:49:40 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2012-10-24 16:49:41 +0200 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction 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]] 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]] 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]]  (7.2ms) commit transaction Redirected to http://127.0.0.1:51454/products Completed 302 Found in 16ms (ActiveRecord: 8.6ms) Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction 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]]  (0.8ms) commit transaction  (0.1ms) begin transaction 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]]  (1.4ms) commit transaction  (0.1ms) begin transaction 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]]  (1.2ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2012-10-24 16:49:42 +0200 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.7ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction 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]] 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]] 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]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2012-10-24 16:49:42 +0200 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.3ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.4ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (112.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:36:49 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:36:49 UTC +00:00]]  (13.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:36:49 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:36:49 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:36:49 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:36:49 UTC +00:00]]  (1.2ms) commit transaction Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (33.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:14 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:14 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:14 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:14 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:14 UTC +00:00], ["name", "category_1"], ["parent_id", 4], ["updated_at", Tue, 04 Feb 2014 14:38:14 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 4 LIMIT 1 Started GET "/categories/6/edit" for 127.0.0.1 at 2014-02-04 15:38:22 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"6"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "6"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 4 LIMIT 1 Rendered categories/_form.html.erb (312.0ms) Rendered categories/edit.html.erb within layouts/application (328.9ms) Completed 200 OK in 514ms (Views: 511.0ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2014-02-04 15:38:23 +0100 Served asset /application.css - 200 OK (51ms) Started GET "/assets/application.js" for 127.0.0.1 at 2014-02-04 15:38:23 +0100 Served asset /application.js - 200 OK (70ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2014-02-04 15:38:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/6" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"5"}, "commit"=>"Update Category", "id"=>"6"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "6"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 5, "updated_at" = '2014-02-04 14:38:25.345939' WHERE "categories"."id" = 6  (1.1ms) commit transaction Redirected to http://127.0.0.1:53926/categories Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Started GET "/categories" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 42ms (Views: 40.6ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 6]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 5 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00]]  (1.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.0ms) Completed 200 OK in 19ms (Views: 18.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (21.5ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:25 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2014-02-04 14:38:25.985135' WHERE "categories"."id" = 3  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2014-02-04 15:38:25 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.9ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:26 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:26 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2014-02-04 15:38:26 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:26 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:26 UTC +00:00]]  (1.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2014-02-04 15:38:26 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2014-02-04 15:38:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2014-02-04 15:38:27 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:27 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:27 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:53926/categories Completed 302 Found in 4ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2014-02-04 15:38:27 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (7.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:27 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:28 UTC +00:00]]  (16.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:28 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:28 UTC +00:00], ["name", "item"], ["updated_at", Tue, 04 Feb 2014 14:38:28 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2014-02-04 15:38:28 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (539.8ms) Completed 200 OK in 616ms (Views: 613.8ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2014-02-04 15:38:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2014-02-04 15:38:30 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2014-02-04 14:38:30.234155' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://127.0.0.1:53926/items Completed 302 Found in 6ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2014-02-04 15:38:30 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 87ms (Views: 85.5ms | ActiveRecord: 0.2ms) Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (35.7ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.9ms) commit transaction  (0.2ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.2ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.0ms) Completed 200 OK in 57ms (Views: 56.4ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (23.3ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 26ms (ActiveRecord: 23.8ms) Started GET "/items" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (71.2ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "item"], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.7ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2014-02-04 14:38:31.655579' WHERE "items"."id" = 1  (1.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 2.0ms) Started GET "/items" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.6ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00], ["name", "new one"], ["updated_at", Tue, 04 Feb 2014 14:38:31 UTC +00:00]]  (1.4ms) commit transaction Started GET "/items" for 127.0.0.1 at 2014-02-04 15:38:31 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.2ms)  (2.6ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:32 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:32 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:32 UTC +00:00]]  (1.1ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2014-02-04 15:38:32 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.9ms) Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2014-02-04 15:38:33 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2014-02-04 15:38:34 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:53926/items Completed 302 Found in 3ms (ActiveRecord: 1.7ms) Started GET "/items" for 127.0.0.1 at 2014-02-04 15:38:34 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["name", "product"], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:34 UTC +00:00]]  (1.4ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2014-02-04 15:38:34 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (22.4ms) Completed 200 OK in 68ms (Views: 65.3ms | ActiveRecord: 0.9ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2014-02-04 15:38:35 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2014-02-04 15:38:37 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (9.2ms) commit transaction Redirected to http://127.0.0.1:53926/products Completed 302 Found in 61ms (ActiveRecord: 10.2ms) Started GET "/products" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 35ms (Views: 34.0ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.3ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.2ms) Completed 200 OK in 39ms (Views: 38.5ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (20.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (10.3ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 42ms (ActiveRecord: 30.9ms) Started GET "/products" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (31.6ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (1.3ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (1.2ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "product"], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (2.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (8.4ms) Completed 200 OK in 12ms (Views: 9.8ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2014-02-04 15:38:38 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (77.8ms) DELETE FROM "categories";  (10.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (4.5ms) DELETE FROM "products";  (12.5ms) DELETE FROM sqlite_sequence where name = 'products';  (7.2ms) DELETE FROM "product_has_categories";  (3.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (14.1ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:38 UTC +00:00]]  (27.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]]  (12.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["name", "new one"], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]]  (1.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2014-02-04 15:38:39 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms)  (1.3ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 04 Feb 2014 14:38:39 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2014-02-04 15:38:39 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.5ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2014-02-04 15:38:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2014-02-04 15:38:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2014-02-04 15:38:42 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 04 Feb 2014 14:38:42 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 04 Feb 2014 14:38:42 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 04 Feb 2014 14:38:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:42 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 04 Feb 2014 14:38:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 04 Feb 2014 14:38:42 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:53926/products Completed 302 Found in 8ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2014-02-04 15:38:42 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.4ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (14.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:07:30 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:13 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:13 UTC +00:00]]  (2.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:13 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:13 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:13 UTC +00:00], ["name", "category_2"], ["parent_id", 4], ["updated_at", Mon, 26 Oct 2015 15:12:13 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 4 LIMIT 1 Started GET "/categories/6/edit" for 127.0.0.1 at 2015-10-26 16:12:13 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"6"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "6"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 4 LIMIT 1 Rendered categories/_form.html.erb (122.5ms) Rendered categories/edit.html.erb within layouts/application (129.2ms) Completed 200 OK in 143ms (Views: 141.7ms | ActiveRecord: 0.4ms) Started PUT "/categories/6" for 127.0.0.1 at 2015-10-26 16:12:14 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"5"}, "commit"=>"Update Category", "id"=>"6"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "6"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 5, "updated_at" = '2015-10-26 15:12:14.014055' WHERE "categories"."id" = 6  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:12:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 6]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 5 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:12:14 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:12:14 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:12:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:14 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:12:16 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (5.3ms) Completed 200 OK in 9ms (Views: 6.7ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:12:16 +0100 Served asset /application.css - 200 OK (7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:12:16 +0100 Served asset /application.js - 200 OK (9ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:12:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:12:17 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:12:17.521990' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://127.0.0.1:53709/categories Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:12:17 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms)  (0.1ms) begin transaction SQL (7.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:17 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:17 UTC +00:00]]  (1.4ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:12:17 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (123.5ms) Completed 200 OK in 130ms (Views: 129.6ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:12:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.4ms | ActiveRecord: 0.4ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:53709/categories Completed 302 Found in 3ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by CategoriesController#index as HTML Category Load (0.5ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 2.4ms | ActiveRecord: 0.5ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms)  (0.7ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (46.3ms) Completed 200 OK in 51ms (Views: 49.0ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.6ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:19 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.5ms) Completed 200 OK in 10ms (Views: 7.7ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:12:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:12:20 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (3.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products"; Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:12:21 +0100  (0.9ms) DELETE FROM sqlite_sequence where name = 'products'; Processing by ProductsController#update as HTML  (1.0ms) DELETE FROM "product_has_categories"; Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"}  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.6ms) DELETE FROM "items"; Completed 500 Internal Server Error in 2ms  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:21 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:21 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:21 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:21 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:21 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:21 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:12:21 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (6.4ms) Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:12:22 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:53709/products Completed 302 Found in 8ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:12:23 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (65.0ms) Completed 200 OK in 70ms (Views: 67.9ms | ActiveRecord: 0.4ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:12:23.984923' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:12:23 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:12:24 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.7ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:12:24 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:12:24 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:12:24 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:12:24 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.0ms) Completed 200 OK in 8ms (Views: 6.2ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:12:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories"; Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:12:25 +0100  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Processing by ItemsController#update as HTML  (0.8ms) DELETE FROM "items"; Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}  (0.8ms) DELETE FROM sqlite_sequence where name = 'items'; Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 1ms  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:25 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:25 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:25 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:12:25 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.6ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:12:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:12:26 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:53709/items Completed 302 Found in 5ms (ActiveRecord: 2.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:12:26 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:12:26 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:12:26 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:19 UTC +00:00]]  (2.6ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:13:19 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (27.0ms) Completed 200 OK in 39ms (Views: 38.2ms | ActiveRecord: 0.2ms)  (2.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:19 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:13:20 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (104.4ms) Completed 200 OK in 110ms (Views: 109.5ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:13:21 +0100 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:13:21 +0100 Served asset /application.js - 200 OK (31ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:13:21 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 4ms (Views: 0.4ms | ActiveRecord: 0.8ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:53740/categories Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (6.5ms) Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:13:22.354409' WHERE "categories"."id" = 3  (0.5ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:22 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:13:22 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (3.4ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products'; Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:13:23 +0100  (1.1ms) DELETE FROM "product_has_categories"; Processing by CategoriesController#update as HTML  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}  (0.8ms) DELETE FROM "items"; Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Completed 500 Internal Server Error in 1ms  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (1.1ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:13:23 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:23 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:13:23 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (55.3ms) Completed 200 OK in 58ms (Views: 57.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:53740/items Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.5ms) Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:13:24.822195' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.6ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:13:24 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:13:24 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.8ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:13:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (3.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products"; Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:13:25 +0100  (0.1ms) DELETE FROM sqlite_sequence where name = 'products'; Processing by ItemsController#update as HTML  (0.9ms) DELETE FROM "product_has_categories"; Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.7ms) DELETE FROM "items";  (0.1ms) begin transaction  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:13:25.980611' WHERE "items"."id" = 1  (0.1ms) commit transaction Redirected to http://127.0.0.1:53740/items Completed 302 Found in 5ms (ActiveRecord: 0.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:13:25 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.1ms)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (2.5ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:13:26 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 15ms (Views: 13.8ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:26 UTC +00:00]]  (1.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:13:26 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (10.3ms) Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:13:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:13:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:53740/products Completed 302 Found in 10ms (ActiveRecord: 4.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.6ms) Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.6ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:13:28 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.7ms) Completed 200 OK in 8ms (Views: 6.7ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:13:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:13:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (3.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products"; Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:13:30 +0100  (0.9ms) DELETE FROM sqlite_sequence where name = 'products'; Processing by ProductsController#update as HTML  (0.8ms) DELETE FROM "product_has_categories"; Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"}  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.8ms) DELETE FROM "items"; Completed 500 Internal Server Error in 2ms  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (38.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:15:46 UTC +00:00]]  (5.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:15:48 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (163.0ms) Rendered items/edit.html.erb within layouts/application (169.5ms) Completed 200 OK in 183ms (Views: 180.7ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:15:48 +0100 Served asset /application.css - 200 OK (30ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:15:48 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:15:49 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items'; Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:15:49 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 2ms Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (32.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00]]  (3.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:16:47 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:16:48 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (149.1ms) Rendered items/edit.html.erb within layouts/application (155.1ms) Completed 200 OK in 168ms (Views: 165.7ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:16:48 +0100 Served asset /application.css - 200 OK (30ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:16:49 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:16:52 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"}  (3.3ms) DELETE FROM "categories";  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (1.0ms) DELETE FROM sqlite_sequence where name = 'items'; Completed in 2748ms Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (30.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00]]  (2.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:17:19 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:17:20 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (151.8ms) Rendered items/edit.html.erb within layouts/application (157.5ms) Completed 200 OK in 171ms (Views: 168.1ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:17:20 +0100 Served asset /application.css - 200 OK (29ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:17:20 +0100 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:17:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1004ms (Views: 0.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.7ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products'; Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:17:25 +0100  (1.1ms) DELETE FROM "product_has_categories"; Processing by ItemsController#update as HTML  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}  (0.9ms) DELETE FROM "items"; Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.9ms) DELETE FROM sqlite_sequence where name = 'items'; Completed 500 Internal Server Error in 2ms Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (34.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:18:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:18:57 UTC +00:00]]  (2.3ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:18:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:18:57 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:18:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:18:57 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:19:03 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:19:03 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:19:04 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (155.8ms) Rendered items/edit.html.erb within layouts/application (161.1ms) Completed 200 OK in 174ms (Views: 171.3ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:19:05 +0100 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:19:05 +0100 Served asset /application.js - 200 OK (8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:19:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories"; Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:19:08 +0100  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Processing by ItemsController#update as HTML  (0.9ms) DELETE FROM "items"; Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"}  (0.9ms) DELETE FROM sqlite_sequence where name = 'items'; Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 1ms Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (30.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00]]  (3.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:19:53 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:19:55 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (156.1ms) Rendered items/edit.html.erb within layouts/application (162.1ms) Completed 200 OK in 176ms (Views: 173.7ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:19:55 +0100 Served asset /application.css - 200 OK (32ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:19:55 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:19:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:19:56 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:19:56.405248' WHERE "items"."id" = 1  (3.6ms) commit transaction Redirected to http://127.0.0.1:53840/items Completed 302 Found in 15ms (ActiveRecord: 4.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:19:56 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 9ms (Views: 5.9ms | ActiveRecord: 0.2ms) Item Load (1.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (37.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00]]  (7.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:20:32 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:20:33 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (150.2ms) Rendered items/edit.html.erb within layouts/application (155.9ms) Completed 200 OK in 169ms (Views: 166.6ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:20:33 +0100 Served asset /application.css - 200 OK (37ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:20:33 +0100 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:20:34 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:20:34 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:20:34.896734' WHERE "items"."id" = 1  (2.6ms) commit transaction Redirected to http://127.0.0.1:53852/items Completed 302 Found in 7ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:20:34 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.0ms) begin transaction SQL (29.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:20:49 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:20:49 UTC +00:00]]  (3.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:20:49 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:20:49 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:20:49 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:20:49 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:20:50 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:20:50 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:20:51 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (150.3ms) Rendered items/edit.html.erb within layouts/application (155.6ms) Completed 200 OK in 168ms (Views: 165.5ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:20:51 +0100 Served asset /application.css - 200 OK (29ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:20:51 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:20:52 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:20:52 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:20:52.766588' WHERE "items"."id" = 1  (3.4ms) commit transaction Redirected to http://127.0.0.1:53862/items Completed 302 Found in 8ms (ActiveRecord: 4.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:20:52 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (2.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (108.0ms) Rendered categories/edit.html.erb within layouts/application (113.0ms) Completed 200 OK in 124ms (Views: 122.9ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:21:32.322357' WHERE "categories"."id" = 3  (2.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:21:32 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:32 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:21:33 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 7ms (Views: 5.4ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:21:33 +0100 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:21:33 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:21:34 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products'; Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:21:35 +0100  (1.0ms) DELETE FROM "product_has_categories"; Processing by CategoriesController#update as HTML  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"}  (0.8ms) DELETE FROM "items"; Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Completed 500 Internal Server Error in 2ms  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:35 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:35 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:21:35 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:21:35 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:53876/categories Completed 302 Found in 5ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (58.9ms) Completed 200 OK in 63ms (Views: 61.7ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:21:36.394093' WHERE "items"."id" = 1  (2.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.5ms) Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:21:36 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.9ms) Completed 200 OK in 9ms (Views: 7.2ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:21:36 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:21:37 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:21:37.581472' WHERE "items"."id" = 1  (2.9ms) commit transaction Redirected to http://127.0.0.1:53876/items Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:21:37 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:37 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:37 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:37 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:37 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:37 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:37 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:21:37 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.8ms) Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:53876/items Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (2.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (16.1ms) Completed 200 OK in 20ms (Views: 18.5ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 41ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.9ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:21:38 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:38 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:21:39 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]]  (2.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:39 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:21:39 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.7ms) Completed 200 OK in 8ms (Views: 6.5ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:21:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:21:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (3.2ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products'; Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:21:41 +0100  (1.1ms) DELETE FROM "product_has_categories"; Processing by ProductsController#update as HTML  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories'; Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"}  (0.9ms) DELETE FROM "items"; Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Completed 500 Internal Server Error in 1ms  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:41 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:41 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:41 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:41 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:41 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:21:41 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:21:41 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (6.2ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:21:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:21:42 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:21:43 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:21:43 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:21:43 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:21:43 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:43 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:21:43 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:21:43 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:53876/products Completed 302 Found in 8ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:21:43 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:22:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:22:41 UTC +00:00]]  (3.4ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:22:41 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:22:41 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:22:41 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:22:41 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:22:43 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (145.2ms) Rendered categories/edit.html.erb within layouts/application (153.6ms) Completed 200 OK in 172ms (Views: 168.7ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:22:43 +0100 Served asset /application.css - 200 OK (30ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:22:43 +0100 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:22:43 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:22:44 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:22:44.708627' WHERE "categories"."id" = 3  (3.4ms) commit transaction Redirected to http://127.0.0.1:53893/categories Completed 302 Found in 18ms (ActiveRecord: 4.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:22:44 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 8ms (Views: 5.6ms | ActiveRecord: 0.2ms) Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:11 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:11 UTC +00:00]]  (3.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:11 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:11 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:11 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:11 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:23:12 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (102.4ms) Rendered categories/edit.html.erb within layouts/application (108.3ms) Completed 200 OK in 121ms (Views: 118.8ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:23:12 +0100 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:23:12 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:23:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:23:13 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:23:13.824616' WHERE "categories"."id" = 3  (2.9ms) commit transaction Redirected to http://127.0.0.1:53905/categories Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:23:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:52 UTC +00:00]]  (2.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:23:54 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (111.6ms) Rendered products/edit.html.erb within layouts/application (117.4ms) Completed 200 OK in 157ms (Views: 153.0ms | ActiveRecord: 1.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:23:54 +0100 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:23:54 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:23:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:23:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:23:56 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:53920/products Completed 302 Found in 13ms (ActiveRecord: 4.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:23:56 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:23:56 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.6ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:23:56 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:23:56 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.2ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:56 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:23:56 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.7ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:23:57 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:53920/products Completed 302 Found in 8ms (ActiveRecord: 3.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (35.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.3ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:23:58 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:23:58 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (2.7ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (33.2ms) Completed 200 OK in 44ms (Views: 43.1ms | ActiveRecord: 0.2ms)  (2.4ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (105.7ms) Completed 200 OK in 111ms (Views: 110.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (5.7ms) Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:24:06.444895' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:24:06 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.3ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:06 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:24:08 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Completed 200 OK in 7ms (Views: 5.5ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:24:08 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:24:08 +0100 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:24:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:24:09 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:24:09.166741' WHERE "categories"."id" = 3  (2.7ms) commit transaction Redirected to http://127.0.0.1:53933/categories Completed 302 Found in 6ms (ActiveRecord: 3.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:24:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:09 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:09 UTC +00:00]]  (0.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:24:09 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:24:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (3.4ms) commit transaction Redirected to http://127.0.0.1:53933/categories Completed 302 Found in 6ms (ActiveRecord: 3.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.2ms)  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (64.4ms) Completed 200 OK in 67ms (Views: 67.0ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (2.3ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 2.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.3ms) Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:24:10.550968' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:24:10 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.2ms) Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:24:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:24:11 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:24:11.662966' WHERE "items"."id" = 1  (3.0ms) commit transaction Redirected to http://127.0.0.1:53933/items Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:24:11 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:11 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:11 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:11 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:11 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:11 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:11 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:24:11 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.0ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:24:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:24:12 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:53933/items Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:24:12 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:24:12 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 18ms (Views: 16.0ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:12 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:24:12 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.3ms) Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.3ms) Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:13 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.9ms) Completed 200 OK in 9ms (Views: 6.8ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:24:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:24:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:24:15 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:53933/products Completed 302 Found in 9ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:24:15 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:24:15 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:24:15 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.6ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:24:15 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:24:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:24:17 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:24:17 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:24:17 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:24:17 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:17 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:24:17 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:24:17 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:53933/products Completed 302 Found in 9ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:24:17 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (8.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00]]  (1.0ms) commit transaction  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:03 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (2.8ms) commit transaction  (0.6ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.5ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.8ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:28:04 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.7ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.8ms) commit transaction  (0.6ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.7ms) commit transaction  (0.6ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:28:05 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.0ms) begin transaction SQL (5.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:31 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:31 UTC +00:00]]  (2.4ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (2.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (0.8ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (0.7ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:32 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.6ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (2.6ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.6ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (3.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.5ms) commit transaction  (0.6ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:29:33 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (11.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (3.1ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.7ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:44 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (2.6ms) commit transaction  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (1.1ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (3.0ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.0ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.0ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.8ms) commit transaction  (1.0ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:29:46 UTC +00:00]]  (1.0ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00]]  (3.2ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:30:57 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (2.3ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.6ms) commit transaction  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (1.1ms) commit transaction  (0.6ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:30:59 UTC +00:00]]  (0.9ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00]]  (3.5ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:14 UTC +00:00]]  (2.5ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (3.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.6ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.4ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (1.0ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:31:16 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:33:17 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:33:17 UTC +00:00]]  (3.3ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:33:17 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:33:17 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:33:17 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:33:17 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:00 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:34:00 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:00 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:00 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:34:00 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:00 UTC +00:00]]  (2.9ms) commit transaction  (1.0ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:15 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:15 UTC +00:00]]  (3.4ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:34:15 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (104.5ms) Rendered categories/new.html.erb within layouts/application (109.8ms) Completed 200 OK in 121ms (Views: 120.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:34:15 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:15 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:15 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:34:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:34:16 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.8ms) Rendered categories/edit.html.erb within layouts/application (4.3ms) Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:34:16 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:34:16.067890' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:34:16 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:16 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:34:17 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.2ms) Rendered categories/edit.html.erb within layouts/application (4.5ms) Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:34:17 +0100 Compiled token-input-facebook.css (0ms) (pid 33553) Compiled application.css (4ms) (pid 33553) Served asset /application.css - 200 OK (13ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:34:17 +0100 Compiled jquery.js (3ms) (pid 33553) Compiled jquery_ujs.js (0ms) (pid 33553) Compiled jquery.tokeninput.js (0ms) (pid 33553) Compiled application.js (18ms) (pid 33553) Served asset /application.js - 200 OK (54ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:34:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:34:18 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:34:18.999682' WHERE "categories"."id" = 3  (2.5ms) commit transaction Redirected to http://127.0.0.1:54170/categories Completed 302 Found in 5ms (ActiveRecord: 2.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:34:19 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.6ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:19 UTC +00:00]]  (1.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:34:19 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.1ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:34:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:34:20 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:54170/categories Completed 302 Found in 5ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:34:20 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:34:20 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (37.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:34:20 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (45.0ms) Completed 200 OK in 48ms (Views: 47.1ms | ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:20 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:34:20 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.5ms) Rendered products/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:34:20 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:34:21 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (3.4ms) commit transaction Redirected to http://127.0.0.1:54170/products Completed 302 Found in 12ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.9ms) Rendered products/edit.html.erb within layouts/application (6.1ms) Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.7ms) Rendered products/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:22 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:34:22 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.3ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:34:23 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:54170/products Completed 302 Found in 7ms (ActiveRecord: 3.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.2ms)  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (57.2ms) Rendered items/new.html.erb within layouts/application (58.1ms) Completed 200 OK in 60ms (Views: 59.5ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:24 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:34:24 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.7ms) Rendered items/new.html.erb within layouts/application (4.9ms) Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:34:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.0ms) begin transaction SQL (2.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:54170/items Completed 302 Found in 7ms (ActiveRecord: 5.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.9ms) Rendered items/edit.html.erb within layouts/application (5.5ms) Completed 200 OK in 8ms (Views: 6.8ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:34:26.114951' WHERE "items"."id" = 1  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:34:26 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.6ms) Rendered items/edit.html.erb within layouts/application (4.9ms) Completed 200 OK in 7ms (Views: 5.8ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:34:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:34:27 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:34:27.223078' WHERE "items"."id" = 1  (2.3ms) commit transaction Redirected to http://127.0.0.1:54170/items Completed 302 Found in 5ms (ActiveRecord: 2.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:34:27 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (9.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (2.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:03 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (14.4ms) Completed 200 OK in 51ms (Views: 50.0ms | ActiveRecord: 0.3ms)  (2.6ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:42:03 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (111.4ms) Rendered products/edit.html.erb within layouts/application (115.0ms) Completed 200 OK in 119ms (Views: 116.2ms | ActiveRecord: 0.7ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:42:03 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:03 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:03 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:42:05 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.6ms) Rendered products/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:42:05 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:42:05 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:42:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:42:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:42:07 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:54293/products Completed 302 Found in 10ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:07 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.4ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:42:07 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (33.9ms) Rendered products/new.html.erb within layouts/application (34.1ms) Completed 200 OK in 35ms (Views: 34.9ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:42:07 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:07 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:07 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:42:07 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (7.0ms) Rendered products/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:42:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:42:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:42:09 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:42:09 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:09 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:54293/products Completed 302 Found in 8ms (ActiveRecord: 3.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:09 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.0ms) begin transaction SQL (7.2ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:23 UTC +00:00]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:23 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:23 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:42:25 +0100 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (160.1ms) Rendered products/new.html.erb within layouts/application (166.1ms) Completed 200 OK in 182ms (Views: 176.7ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:42:25 +0100 Served asset /application.css - 200 OK (29ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:42:25 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:42:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:42:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:42:27 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:54307/products Completed 302 Found in 28ms (ActiveRecord: 4.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (4.2ms) Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.4ms) Product Load (0.3ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (4.7ms) DELETE FROM "categories";  (1.4ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.5ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:42:27 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.3ms) Rendered products/edit.html.erb within layouts/application (6.8ms) Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:42:27 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:27 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:42:27 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.3ms) Rendered products/edit.html.erb within layouts/application (5.5ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:42:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:42:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:42:29 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:42:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:29 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:54307/products Completed 302 Found in 8ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:29 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:30 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.5ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:42:30 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.3ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:42:30 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:42:30 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:42:30 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00]]  (2.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:47:23 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:47:24 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (157.5ms) Rendered items/edit.html.erb within layouts/application (163.1ms) Completed 200 OK in 175ms (Views: 173.1ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:47:24 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:47:24.225148' WHERE "items"."id" = 1  (2.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:47:24 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:47:24 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:24 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:47:25 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.3ms) Rendered items/new.html.erb within layouts/application (4.9ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:47:26 +0100 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:47:26 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:47:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.8ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:47:27 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:54391/items Completed 302 Found in 7ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:47:27 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:47:27 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:47:27 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (7.5ms) Rendered items/edit.html.erb within layouts/application (7.9ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:47:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:47:28 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:47:28.368962' WHERE "items"."id" = 1  (2.7ms) commit transaction Redirected to http://127.0.0.1:54391/items Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:47:28 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:47:28 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.7ms) Rendered items/new.html.erb within layouts/application (5.1ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:47:28 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:47:28 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:47:28 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:49:58 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:49:58 UTC +00:00]]  (3.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:49:59 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (138.0ms) Rendered categories/new.html.erb within layouts/application (143.9ms) Completed 200 OK in 156ms (Views: 155.0ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:49:59 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:49:59 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:50:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00]]  (3.4ms) commit transaction Redirected to http://127.0.0.1:54427/categories Completed 302 Found in 7ms (ActiveRecord: 4.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.6ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Rendered categories/new.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:01 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.4ms) Rendered categories/edit.html.erb within layouts/application (4.9ms) Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:50:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:50:02 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:50:02.234989' WHERE "categories"."id" = 3  (3.0ms) commit transaction Redirected to http://127.0.0.1:54427/categories Completed 302 Found in 7ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:02 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:50:02 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.5ms) Rendered categories/edit.html.erb within layouts/application (3.7ms) Completed 200 OK in 6ms (Views: 4.8ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:50:02 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:50:02.323361' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00]]  (2.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:08 UTC +00:00]]  (2.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:50:10 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (163.9ms) Rendered products/edit.html.erb within layouts/application (169.9ms) Completed 200 OK in 183ms (Views: 179.6ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:50:10 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:50:10 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:50:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:50:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:54443/products Completed 302 Found in 10ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (2.6ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.9ms) Rendered products/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 8ms (Views: 6.8ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 2)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.3ms)  (0.7ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:12 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.1ms) Rendered products/new.html.erb within layouts/application (5.6ms) Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:50:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:50:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:54443/products Completed 302 Found in 9ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.1ms) Rendered products/new.html.erb within layouts/application (5.4ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (69.8ms) Rendered items/edit.html.erb within layouts/application (70.6ms) Completed 200 OK in 74ms (Views: 72.8ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:50:14.860389' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.5ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.9ms) Rendered items/new.html.erb within layouts/application (4.5ms) Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:14 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:50:14 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.7ms) Rendered items/new.html.erb within layouts/application (3.9ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:50:15 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:50:16 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (3.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:54443/items Completed 302 Found in 10ms (ActiveRecord: 6.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:50:16 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.5ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.5ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "new one"], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (3.3ms) commit transaction Started GET "/items" for 127.0.0.1 at 2015-10-26 16:50:16 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms)  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.6ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (1.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:50:16 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:50:16 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (8.3ms) Rendered items/edit.html.erb within layouts/application (8.7ms) Completed 200 OK in 11ms (Views: 10.2ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:50:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:50:17 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:50:17.334831' WHERE "items"."id" = 1  (2.7ms) commit transaction Redirected to http://127.0.0.1:54443/items Completed 302 Found in 7ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:50:17 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:17 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:17 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:17 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.2ms)  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:17 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:17 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:50:17 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.7ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:50:17 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:18 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:50:18 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.3ms) Rendered categories/edit.html.erb within layouts/application (4.9ms) Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:50:18 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:50:18.079841' WHERE "categories"."id" = 3  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:18 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:18 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:50:18 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (2.7ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:50:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:50:19 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.4ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:54443/categories Completed 302 Found in 5ms (ActiveRecord: 2.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:19 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms) Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (3.3ms) DELETE FROM "categories";  (1.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.8ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (4.5ms) DELETE FROM "product_has_categories";  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (2.8ms) DELETE FROM "items";  (0.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:50:19 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:50:19 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.7ms) Rendered categories/edit.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:50:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:50:20 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:50:20.483847' WHERE "categories"."id" = 3  (2.6ms) commit transaction Redirected to http://127.0.0.1:54443/categories Completed 302 Found in 5ms (ActiveRecord: 3.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:50:20 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:30 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:30 UTC +00:00]]  (3.1ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:30 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:30 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:30 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:30 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:58:32 +0100 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (235.0ms) Rendered products/new.html.erb within layouts/application (275.2ms) Completed 200 OK in 304ms (Views: 295.1ms | ActiveRecord: 1.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 16:58:33 +0100 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 16:58:33 +0100 Served asset /application.js - 200 OK (9ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:58:33 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 16:58:34 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:58:35 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:54528/products Completed 302 Found in 22ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:58:35 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (2.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:35 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:58:35 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.8ms) Rendered products/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.7ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:58:35 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:58:36 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:54528/products Completed 302 Found in 12ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.9ms) Rendered products/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.7ms) Rendered products/new.html.erb within layouts/application (4.9ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (5.3ms) Rendered categories/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:58:37.884536' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Rendered categories/new.html.erb within layouts/application (3.0ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:37 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 16:58:37 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.9ms) Rendered categories/edit.html.erb within layouts/application (4.1ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 16:58:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 16:58:39 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 15:58:39.078619' WHERE "categories"."id" = 3  (2.6ms) commit transaction Redirected to http://127.0.0.1:54528/categories Completed 302 Found in 5ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:58:39 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:39 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:39 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 16:58:39 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (2.6ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 16:58:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 16:58:40 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:54528/categories Completed 302 Found in 5ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 16:58:40 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:58:40 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:58:40 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (62.9ms) Rendered items/edit.html.erb within layouts/application (63.7ms) Completed 200 OK in 68ms (Views: 65.7ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 16:58:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:58:41 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:58:41.450748' WHERE "items"."id" = 1  (3.4ms) commit transaction Redirected to http://127.0.0.1:54528/items Completed 302 Found in 7ms (ActiveRecord: 3.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:58:41 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:41 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:41 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:41 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:41 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:41 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:41 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:58:41 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.3ms) Rendered items/new.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 16:58:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:54528/items Completed 302 Found in 5ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.6ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.7ms) Rendered items/edit.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 15:58:42.738904' WHERE "items"."id" = 1  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.5ms) Rendered items/new.html.erb within layouts/application (3.8ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 15:58:42 UTC +00:00]]  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 16:58:42 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:55 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:00:55 UTC +00:00]]  (2.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:55 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:00:55 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:55 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:00:55 UTC +00:00]]  (0.6ms) commit transaction  (0.9ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:57 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:00:57 UTC +00:00]]  (2.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:00:57 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (102.5ms) Rendered categories/new.html.erb within layouts/application (131.4ms) Completed 200 OK in 142ms (Views: 141.3ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:00:57 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:00:57 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 17:00:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:00:58 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00]]  (2.2ms) commit transaction Redirected to http://127.0.0.1:54563/categories Completed 302 Found in 5ms (ActiveRecord: 2.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:00:58 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00]]  (0.7ms) commit transaction  (1.1ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:00:58 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.3ms) Rendered categories/new.html.erb within layouts/application (2.5ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:00:58 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:00:58 UTC +00:00]]  (0.5ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:00:58 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (2.4ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:02:58 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (111.7ms) Rendered categories/edit.html.erb within layouts/application (118.8ms) Completed 200 OK in 136ms (Views: 134.7ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:02:58 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:02:58.496385' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:02:58 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:02:58 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Rendered categories/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:02:58 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:02:58 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:02:58 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:03:00 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.0ms) Rendered categories/edit.html.erb within layouts/application (4.3ms) Completed 200 OK in 8ms (Views: 5.4ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:03:00 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:03:00 +0100 Served asset /application.js - 200 OK (33ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 17:03:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:03:01 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:03:01.509745' WHERE "categories"."id" = 3  (5.8ms) commit transaction Redirected to http://127.0.0.1:54616/categories Completed 302 Found in 9ms (ActiveRecord: 6.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:03:01 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:01 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:01 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:03:01 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Rendered categories/new.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 17:03:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:03:02 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:02 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:03:02 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:54616/categories Completed 302 Found in 5ms (ActiveRecord: 3.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:03:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00]]  (2.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:03:23 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (101.4ms) Rendered categories/edit.html.erb within layouts/application (106.5ms) Completed 200 OK in 118ms (Views: 116.2ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:03:23 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:03:23.294206' WHERE "categories"."id" = 3  (2.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:03:23 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:03:23 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (3.0ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:03:23 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:03:23 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:23 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:03:24 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Rendered categories/new.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:03:25 +0100 Served asset /application.css - 200 OK (4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:03:25 +0100 Served asset /application.js - 200 OK (32ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 17:03:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.8ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:03:26 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:54629/categories Completed 302 Found in 5ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:03:26 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:03:26 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:03:26 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.5ms) Rendered categories/edit.html.erb within layouts/application (3.7ms) Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 17:03:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:03:27 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:03:27.313732' WHERE "categories"."id" = 3  (2.9ms) commit transaction Redirected to http://127.0.0.1:54629/categories Completed 302 Found in 6ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:03:27 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:04:22 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:04:22 UTC +00:00]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:04:22 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:04:22 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:04:23 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (156.7ms) Rendered items/edit.html.erb within layouts/application (162.6ms) Completed 200 OK in 209ms (Views: 206.0ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:04:24 +0100 Served asset /application.css - 200 OK (5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:04:24 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:04:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.1ms | ActiveRecord: 0.2ms)  (1.4ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items'; Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:04:27 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.0ms) Rendered items/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:04:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms)  (3.1ms) DELETE FROM "categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:04:30 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (4.7ms) Rendered items/edit.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.3ms)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00]]  (0.6ms) commit transaction Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:04:30 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:04:30.519610' WHERE "items"."id" = 1  (0.5ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:04:30 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items'; Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:04:30 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.6ms) Rendered items/new.html.erb within layouts/application (3.8ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00]]  (0.7ms) commit transaction Started POST "/items" for 127.0.0.1 at 2015-10-26 17:04:30 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:04:30 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:04:30 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (2.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:05:25 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (158.5ms) Rendered items/new.html.erb within layouts/application (163.9ms) Completed 200 OK in 220ms (Views: 178.5ms | ActiveRecord: 0.3ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 17:05:25 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:05:25 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:05:25 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.6ms) Rendered items/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:05:25 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:05:25.462130' WHERE "items"."id" = 1  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:05:25 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:25 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:05:27 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.2ms) Rendered items/new.html.erb within layouts/application (6.5ms) Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:05:27 +0100 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:05:27 +0100 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:05:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 17:05:28 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00]]  (2.2ms) commit transaction Redirected to http://127.0.0.1:54663/items Completed 302 Found in 5ms (ActiveRecord: 2.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:05:28 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:05:28 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:05:28 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.7ms) Rendered items/edit.html.erb within layouts/application (6.0ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:05:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:05:29 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:05:29.665579' WHERE "items"."id" = 1  (2.4ms) commit transaction Redirected to http://127.0.0.1:54663/items Completed 302 Found in 5ms (ActiveRecord: 2.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:05:29 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.9ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (7.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:23 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:23 UTC +00:00]]  (12.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:23 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:23 UTC +00:00]]  (3.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:23 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:23 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 17:06:24 +0100 Processing by ProductsController#new as HTML  (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  (0.2ms) 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 Rendered products/_form.html.erb (163.7ms) Rendered products/new.html.erb within layouts/application (169.8ms) Completed 200 OK in 186ms (Views: 179.8ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:06:25 +0100 Served asset /application.css - 200 OK (29ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:06:25 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:06:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 17:06:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 17:06:27 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:54683/products Completed 302 Found in 20ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:06:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.7ms) Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:27 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 17:06:27 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.0ms) Rendered products/edit.html.erb within layouts/application (6.7ms) Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:06:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:06:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:54683/products Completed 302 Found in 13ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.2ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.0ms) Rendered products/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.2ms) Rendered products/edit.html.erb within layouts/application (5.5ms) Completed 200 OK in 8ms (Views: 6.4ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:06:29 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:06:29 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.0ms) begin transaction SQL (6.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:22 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:22 UTC +00:00]]  (2.4ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:22 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:22 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:22 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:22 UTC +00:00]]  (0.5ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:14:23 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (158.0ms) Rendered items/new.html.erb within layouts/application (187.4ms) Completed 200 OK in 206ms (Views: 200.1ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:14:24 +0100 Compiled token-input-facebook.css (0ms) (pid 34509) Compiled application.css (5ms) (pid 34509) Served asset /application.css - 200 OK (12ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:14:24 +0100 Compiled jquery.js (3ms) (pid 34509) Compiled jquery_ujs.js (0ms) (pid 34509) Compiled jquery.tokeninput.js (0ms) (pid 34509) Compiled application.js (18ms) (pid 34509) Served asset /application.js - 200 OK (55ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:14:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.4ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 17:14:25 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:54924/items Completed 302 Found in 7ms (ActiveRecord: 3.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:14:25 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:14:25 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:14:25 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.2ms) Rendered items/edit.html.erb within layouts/application (5.8ms) Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:14:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:14:26.623650' WHERE "items"."id" = 1  (4.5ms) commit transaction Redirected to http://127.0.0.1:54924/items Completed 302 Found in 11ms (ActiveRecord: 5.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (6.6ms) Rendered items/edit.html.erb within layouts/application (6.9ms) Completed 200 OK in 10ms (Views: 8.2ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:14:26.726477' WHERE "items"."id" = 1  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.8ms) Rendered items/new.html.erb within layouts/application (4.0ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.5ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:26 UTC +00:00]]  (2.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 17:14:26 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (16.2ms) Rendered products/edit.html.erb within layouts/application (17.1ms) Completed 200 OK in 21ms (Views: 18.6ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:14:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:14:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 17:14:28 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 16:14:28 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:28 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:54924/products Completed 302 Found in 10ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:14:29 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:29 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:29 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:29 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:29 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:29 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:29 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 17:14:29 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.5ms) Rendered products/new.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:14:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 17:14:30 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:54924/products Completed 302 Found in 8ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (4.4ms) Rendered products/new.html.erb within layouts/application (4.7ms) Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.1ms) Rendered products/edit.html.erb within layouts/application (5.4ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.4ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6ms (ActiveRecord: 1.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.7ms) Rendered categories/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.2ms) Rendered categories/edit.html.erb within layouts/application (4.8ms) Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.4ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:14:31.476875' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:31 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (3.5ms) Rendered categories/edit.html.erb within layouts/application (3.7ms) Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 17:14:31 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:14:32 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:14:32.597455' WHERE "categories"."id" = 3  (2.6ms) commit transaction Redirected to http://127.0.0.1:54924/categories Completed 302 Found in 5ms (ActiveRecord: 3.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:14:32 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:32 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:14:32 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:14:32 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (2.7ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 17:14:33 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:14:33 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:14:33 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:14:33 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:54924/categories Completed 302 Found in 5ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:14:33 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (12.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:08 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:08 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:46:10 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (114.3ms) Rendered categories/new.html.erb within layouts/application (146.4ms) Completed 200 OK in 161ms (Views: 160.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 17:46:10 +0100 Compiled token-input-facebook.css (0ms) (pid 35143) Compiled application.css (6ms) (pid 35143) Served asset /application.css - 200 OK (13ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 17:46:10 +0100 Compiled jquery.js (3ms) (pid 35143) Compiled jquery_ujs.js (0ms) (pid 35143) Compiled jquery.tokeninput.js (0ms) (pid 35143) Compiled application.js (47ms) (pid 35143) Served asset /application.js - 200 OK (57ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 17:46:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.6ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:46:12 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:55355/categories Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:46:12 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5ms (Views: 3.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:12 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:46:12 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Rendered categories/edit.html.erb within layouts/application (4.7ms) Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 17:46:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:46:13.267717' WHERE "categories"."id" = 3  (2.8ms) commit transaction Redirected to http://127.0.0.1:55355/categories Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (2.7ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.0ms) Rendered categories/edit.html.erb within layouts/application (4.3ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-26 16:46:13.382262' WHERE "categories"."id" = 3  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (65.2ms) Rendered items/new.html.erb within layouts/application (66.1ms) Completed 200 OK in 75ms (Views: 68.8ms | ActiveRecord: 0.3ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.1ms) Rendered items/edit.html.erb within layouts/application (5.7ms) Completed 200 OK in 9ms (Views: 7.0ms | ActiveRecord: 0.4ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:46:13.540192' WHERE "items"."id" = 1  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:13 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (36.9ms) Rendered items/new.html.erb within layouts/application (37.2ms) Completed 200 OK in 39ms (Views: 38.5ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:46:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 17:46:14 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:55355/items Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:46:14 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00], ["name", "item"], ["updated_at", Mon, 26 Oct 2015 16:46:14 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 17:46:14 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.2ms) Rendered items/edit.html.erb within layouts/application (5.4ms) Completed 200 OK in 8ms (Views: 6.5ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:46:15 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-26 17:46:15 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-26 16:46:15.850431' WHERE "items"."id" = 1  (3.2ms) commit transaction Redirected to http://127.0.0.1:55355/items Completed 302 Found in 6ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 17:46:15 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:15 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 17:46:15 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (50.1ms) Rendered products/edit.html.erb within layouts/application (51.2ms) Completed 200 OK in 56ms (Views: 53.6ms | ActiveRecord: 0.7ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.7ms) Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.0ms) Rendered products/new.html.erb within layouts/application (5.7ms) Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:16 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by ProductsController#new as HTML  (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  (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 Rendered products/_form.html.erb (5.3ms) Rendered products/new.html.erb within layouts/application (5.5ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:46:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 17:46:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 17:46:18 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["name", "hello"], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:55355/products Completed 302 Found in 8ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:46:18 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["name", "product"], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:18 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 17:46:18 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (5.5ms) Rendered products/edit.html.erb within layouts/application (5.7ms) Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 17:46:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 17:46:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-26 17:46:20 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.5ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Mon, 26 Oct 2015 16:46:20 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 26 Oct 2015 16:46:20 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:55355/products Completed 302 Found in 12ms (ActiveRecord: 2.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 17:46:20 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 8ms (Views: 4.8ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:27.387946"], ["updated_at", "2015-10-26 18:41:27.387946"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:27.394219"], ["updated_at", "2015-10-26 18:41:27.394219"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:27.396914"], ["updated_at", "2015-10-26 18:41:27.396914"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 19:41:27 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (148.1ms) Rendered items/new.html.erb within layouts/application (153.7ms) Completed 200 OK in 501ms (Views: 495.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 19:41:27 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:27.946423"], ["updated_at", "2015-10-26 18:41:27.946423"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:27.950015"], ["updated_at", "2015-10-26 18:41:27.950015"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:27.953241"], ["updated_at", "2015-10-26 18:41:27.953241"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-26 18:41:27.956895"], ["updated_at", "2015-10-26 18:41:27.956895"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 19:41:27 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.6ms) Rendered items/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 17ms (Views: 10.2ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-26 19:41:27 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction  (0.0ms) rollback transaction Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.2ms)  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.7ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:28.009876"], ["updated_at", "2015-10-26 18:41:28.009876"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:28.013030"], ["updated_at", "2015-10-26 18:41:28.013030"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:28.015937"], ["updated_at", "2015-10-26 18:41:28.015937"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-26 18:41:28.019202"], ["updated_at", "2015-10-26 18:41:28.019202"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 19:41:29 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (9.0ms) Rendered items/edit.html.erb within layouts/application (9.2ms) Completed 200 OK in 13ms (Views: 11.1ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:29 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:29 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 19:41:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-26 19:41:30 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction  (0.0ms) rollback transaction Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.2ms)  (17.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:30.760245"], ["updated_at", "2015-10-26 18:41:30.760245"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:30.763328"], ["updated_at", "2015-10-26 18:41:30.763328"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:30.765855"], ["updated_at", "2015-10-26 18:41:30.765855"]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 19:41:30 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.2ms) Rendered items/new.html.erb within layouts/application (4.4ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:30 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:30 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 19:41:31 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 19:41:31 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"} Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)  (2.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:31.895501"], ["updated_at", "2015-10-26 18:41:31.895501"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:41:31 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.9ms) Rendered categories/new.html.erb within layouts/application (7.0ms) Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:31 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:31 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 19:41:32 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:41:32 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)  (3.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:33.028550"], ["updated_at", "2015-10-26 18:41:33.028550"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-26 18:41:33.031783"], ["updated_at", "2015-10-26 18:41:33.031783"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-26 18:41:33.034485"], ["updated_at", "2015-10-26 18:41:33.034485"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:41:33 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.2ms) Rendered categories/edit.html.erb within layouts/application (3.8ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:33 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:33 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 19:41:33 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction  (0.0ms) rollback transaction Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.3ms)  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:34.168832"], ["updated_at", "2015-10-26 18:41:34.168832"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-26 18:41:34.171463"], ["updated_at", "2015-10-26 18:41:34.171463"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-26 18:41:34.174013"], ["updated_at", "2015-10-26 18:41:34.174013"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.3ms) Rendered categories/edit.html.erb within layouts/application (3.4ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction  (0.0ms) rollback transaction Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.2ms)  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:34.199620"], ["updated_at", "2015-10-26 18:41:34.199620"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Rendered categories/new.html.erb within layouts/application (2.9ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:34.227192"], ["updated_at", "2015-10-26 18:41:34.227192"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:34.230104"], ["updated_at", "2015-10-26 18:41:34.230104"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:34.232797"], ["updated_at", "2015-10-26 18:41:34.232797"]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (22.9ms) Rendered products/new.html.erb within layouts/application (25.0ms) Completed 200 OK in 36ms (Views: 28.8ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:34.292376"], ["updated_at", "2015-10-26 18:41:34.292376"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:34.295434"], ["updated_at", "2015-10-26 18:41:34.295434"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:34.298088"], ["updated_at", "2015-10-26 18:41:34.298088"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.4ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-26 18:41:34.313742"], ["updated_at", "2015-10-26 18:41:34.313742"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 18:41:34.316335"], ["updated_at", "2015-10-26 18:41:34.316335"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 18:41:34.318645"], ["updated_at", "2015-10-26 18:41:34.318645"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (13.3ms) Rendered products/edit.html.erb within layouts/application (14.1ms) Completed 200 OK in 19ms (Views: 17.4ms | ActiveRecord: 0.7ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction  (0.1ms) rollback transaction Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.4ms)  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:41:34.366591"], ["updated_at", "2015-10-26 18:41:34.366591"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:41:34.369594"], ["updated_at", "2015-10-26 18:41:34.369594"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:41:34.372137"], ["updated_at", "2015-10-26 18:41:34.372137"]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-26 18:41:34.377922"], ["updated_at", "2015-10-26 18:41:34.377922"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 18:41:34.379347"], ["updated_at", "2015-10-26 18:41:34.379347"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 18:41:34.380539"], ["updated_at", "2015-10-26 18:41:34.380539"]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.5ms) Rendered products/edit.html.erb within layouts/application (6.8ms) Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 19:41:34 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 19:41:35 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-26 19:41:36 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction  (0.0ms) rollback transaction Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.2ms)  (3.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:47.716951"], ["updated_at", "2015-10-26 18:41:47.716951"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-26 18:41:47.722885"], ["updated_at", "2015-10-26 18:41:47.722885"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-26 18:41:47.725586"], ["updated_at", "2015-10-26 18:41:47.725586"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:41:47 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (112.7ms) Rendered categories/edit.html.erb within layouts/application (117.8ms) Completed 200 OK in 287ms (Views: 282.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:41:48 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction  (0.1ms) rollback transaction Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.3ms)  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:48.066590"], ["updated_at", "2015-10-26 18:41:48.066590"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:41:48 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Rendered categories/new.html.erb within layouts/application (5.1ms) Completed 200 OK in 16ms (Views: 15.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:41:48 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:48.108929"], ["updated_at", "2015-10-26 18:41:48.108929"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:41:49 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.5ms) Rendered categories/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:49 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:49 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 19:41:49 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (2.6ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 2.6ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:41:50 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (1.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.7ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:41:50.703004"], ["updated_at", "2015-10-26 18:41:50.703004"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-26 18:41:50.707076"], ["updated_at", "2015-10-26 18:41:50.707076"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-26 18:41:50.710421"], ["updated_at", "2015-10-26 18:41:50.710421"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:41:50 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.8ms) Rendered categories/edit.html.erb within layouts/application (5.1ms) Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:41:50 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:41:50 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 19:41:51 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:41:51 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction  (0.0ms) rollback transaction Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.9ms)  (1.5ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:42:00.187341"], ["updated_at", "2015-10-26 18:42:00.187341"]]  (3.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:42:00 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (115.0ms) Rendered categories/new.html.erb within layouts/application (119.6ms) Completed 200 OK in 275ms (Views: 274.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:42:00 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)  (2.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:43:19.960525"], ["updated_at", "2015-10-26 18:43:19.960525"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:43:19 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (119.9ms) Rendered categories/new.html.erb within layouts/application (125.2ms) Completed 200 OK in 299ms (Views: 298.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:43:20 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:43:38.661986"], ["updated_at", "2015-10-26 18:43:38.661986"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:43:38 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (132.5ms) Rendered categories/new.html.erb within layouts/application (138.8ms) Completed 200 OK in 328ms (Views: 327.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:43:39 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:43:39.021528"], ["updated_at", "2015-10-26 18:43:39.021528"]]  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:43:39 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (6.1ms) Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:43:46.141980"], ["updated_at", "2015-10-26 18:43:46.141980"]]  (2.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-26 18:43:46.149425"], ["updated_at", "2015-10-26 18:43:46.149425"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-26 18:43:46.152051"], ["updated_at", "2015-10-26 18:43:46.152051"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:43:47 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (109.2ms) Rendered categories/edit.html.erb within layouts/application (113.9ms) Completed 200 OK in 359ms (Views: 352.3ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:43:48 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:43:48 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 19:43:48 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 4ms (Views: 0.6ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 18:43:49.493347"], ["id", 3]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:56316/categories Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:43:49.552094"], ["updated_at", "2015-10-26 18:43:49.552094"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.8ms) Rendered categories/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 19:43:49 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:43:50.644337"], ["updated_at", "2015-10-26 18:43:50.644337"]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:56316/categories Completed 302 Found in 6ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:43:50.706452"], ["updated_at", "2015-10-26 18:43:50.706452"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.2ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:43:50.737593"], ["updated_at", "2015-10-26 18:43:50.737593"]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:43:50.763400"], ["updated_at", "2015-10-26 18:43:50.763400"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-26 18:43:50.767208"], ["updated_at", "2015-10-26 18:43:50.767208"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-26 18:43:50.771969"], ["updated_at", "2015-10-26 18:43:50.771969"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (7.1ms) Rendered categories/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 11ms (Views: 9.9ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 18:43:50.801499"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:43:50 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (2.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:45:11.460656"], ["updated_at", "2015-10-26 18:45:11.460656"]]  (2.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-26 18:45:11.468164"], ["updated_at", "2015-10-26 18:45:11.468164"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-26 18:45:11.470827"], ["updated_at", "2015-10-26 18:45:11.470827"]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:45:12 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (120.2ms) Rendered categories/edit.html.erb within layouts/application (124.7ms) Completed 200 OK in 357ms (Views: 352.3ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:45:13 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:45:13 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 19:45:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 7ms (Views: 0.2ms | ActiveRecord: 0.9ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 18:45:14.342351"], ["id", 3]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:56329/categories Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:45:14.403306"], ["updated_at", "2015-10-26 18:45:14.403306"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.8ms) Rendered categories/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 19:45:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:45:15.509840"], ["updated_at", "2015-10-26 18:45:15.509840"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:56329/categories Completed 302 Found in 6ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.6ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:45:15.594385"], ["updated_at", "2015-10-26 18:45:15.594385"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-26 18:45:15.598366"], ["updated_at", "2015-10-26 18:45:15.598366"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-26 18:45:15.601154"], ["updated_at", "2015-10-26 18:45:15.601154"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.4ms) Rendered categories/edit.html.erb within layouts/application (3.6ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 18:45:15.621168"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:45:15.638892"], ["updated_at", "2015-10-26 18:45:15.638892"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.3ms) Rendered categories/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:45:15.660839"], ["updated_at", "2015-10-26 18:45:15.660839"]]  (0.5ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:45:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:46:15.386336"], ["updated_at", "2015-10-26 18:46:15.386336"]]  (2.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-26 18:46:15.393675"], ["updated_at", "2015-10-26 18:46:15.393675"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-26 18:46:15.396356"], ["updated_at", "2015-10-26 18:46:15.396356"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:46:15 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (113.8ms) Rendered categories/edit.html.erb within layouts/application (118.4ms) Completed 200 OK in 300ms (Views: 295.7ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:46:15 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 18:46:15.735751"], ["id", 3]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:46:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (7.7ms) Completed 200 OK in 18ms (Views: 17.7ms | ActiveRecord: 0.3ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:46:15.772303"], ["updated_at", "2015-10-26 18:46:15.772303"]]  (1.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:46:15 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.4ms) Rendered categories/new.html.erb within layouts/application (4.2ms) Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:46:15 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:46:15.794077"], ["updated_at", "2015-10-26 18:46:15.794077"]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:46:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:46:15.817138"], ["updated_at", "2015-10-26 18:46:15.817138"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 19:46:17 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.4ms) Rendered categories/new.html.erb within layouts/application (4.7ms) Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:17 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3ms (Views: 0.6ms | ActiveRecord: 0.6ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 18:46:18.834527"], ["updated_at", "2015-10-26 18:46:18.834527"]]  (0.7ms) commit transaction Redirected to http://127.0.0.1:56339/categories Completed 302 Found in 6ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 18:46:18.914104"], ["updated_at", "2015-10-26 18:46:18.914104"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-26 18:46:18.918297"], ["updated_at", "2015-10-26 18:46:18.918297"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-26 18:46:18.922536"], ["updated_at", "2015-10-26 18:46:18.922536"]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (10.0ms) Rendered categories/edit.html.erb within layouts/application (10.3ms) Completed 200 OK in 14ms (Views: 12.3ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:18 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 19:46:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.2ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 18:46:20.066028"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:56339/categories Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Processing by CategoriesController#index as HTML Category Load (0.4ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (2.5ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:20.152549"], ["updated_at", "2015-10-26 18:46:20.152549"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:20.157322"], ["updated_at", "2015-10-26 18:46:20.157322"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:20.160189"], ["updated_at", "2015-10-26 18:46:20.160189"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-26 18:46:20.172800"], ["updated_at", "2015-10-26 18:46:20.172800"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (35.8ms) Rendered items/edit.html.erb within layouts/application (38.8ms) Completed 200 OK in 45ms (Views: 43.7ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 19:46:20 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-26 18:46:21.349707"], ["id", 1]]  (0.7ms) commit transaction Redirected to http://127.0.0.1:56339/items Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.4ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:21.428953"], ["updated_at", "2015-10-26 18:46:21.428953"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:21.431935"], ["updated_at", "2015-10-26 18:46:21.431935"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:21.435123"], ["updated_at", "2015-10-26 18:46:21.435123"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.8ms) Rendered items/new.html.erb within layouts/application (8.7ms) Completed 200 OK in 13ms (Views: 12.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 19:46:21 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (1.0ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-26 18:46:22.566307"], ["updated_at", "2015-10-26 18:46:22.566307"]]  (1.6ms) commit transaction Redirected to http://127.0.0.1:56339/items Completed 302 Found in 6ms (ActiveRecord: 2.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (2.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:22.645932"], ["updated_at", "2015-10-26 18:46:22.645932"]]  (1.7ms) commit transaction  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:22.652897"], ["updated_at", "2015-10-26 18:46:22.652897"]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:22.659305"], ["updated_at", "2015-10-26 18:46:22.659305"]]  (1.4ms) commit transaction  (0.1ms) begin transaction SQL (1.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-26 18:46:22.665442"], ["updated_at", "2015-10-26 18:46:22.665442"]]  (1.5ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (20.0ms) Rendered items/edit.html.erb within layouts/application (20.5ms) Completed 200 OK in 24ms (Views: 23.2ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (1.0ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-26 18:46:22.714997"], ["id", 1]]  (1.5ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 8ms (ActiveRecord: 2.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (2.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (2.0ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (2.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:22.750476"], ["updated_at", "2015-10-26 18:46:22.750476"]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:22.757807"], ["updated_at", "2015-10-26 18:46:22.757807"]]  (1.6ms) commit transaction  (0.1ms) begin transaction SQL (1.0ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:22.763135"], ["updated_at", "2015-10-26 18:46:22.763135"]]  (1.5ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (8.7ms) Rendered items/new.html.erb within layouts/application (9.1ms) Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-26 18:46:22.797167"], ["updated_at", "2015-10-26 18:46:22.797167"]]  (1.4ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 2.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 6ms (Views: 4.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (2.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (2.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:22.836306"], ["updated_at", "2015-10-26 18:46:22.836306"]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:22.843183"], ["updated_at", "2015-10-26 18:46:22.843183"]]  (1.9ms) commit transaction  (0.1ms) begin transaction SQL (1.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:22.850475"], ["updated_at", "2015-10-26 18:46:22.850475"]]  (1.4ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (26.3ms) Rendered products/new.html.erb within layouts/application (28.8ms) Completed 200 OK in 47ms (Views: 36.5ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:22 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 19:46:23 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 19:46:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-26 18:46:25.054197"], ["updated_at", "2015-10-26 18:46:25.054197"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 18:46:25.055782"], ["updated_at", "2015-10-26 18:46:25.055782"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 18:46:25.056911"], ["updated_at", "2015-10-26 18:46:25.056911"]]  (1.3ms) commit transaction Redirected to http://127.0.0.1:56339/products Completed 302 Found in 23ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (8.9ms) Completed 200 OK in 12ms (Views: 11.2ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:25.135468"], ["updated_at", "2015-10-26 18:46:25.135468"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:25.138347"], ["updated_at", "2015-10-26 18:46:25.138347"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:25.140883"], ["updated_at", "2015-10-26 18:46:25.140883"]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-26 18:46:25.147524"], ["updated_at", "2015-10-26 18:46:25.147524"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 18:46:25.149735"], ["updated_at", "2015-10-26 18:46:25.149735"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 18:46:25.151100"], ["updated_at", "2015-10-26 18:46:25.151100"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.0ms) Rendered products/edit.html.erb within layouts/application (6.6ms) Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 19:46:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 19:46:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-26 18:46:27.289686"], ["updated_at", "2015-10-26 18:46:27.289686"]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:56339/products Completed 302 Found in 9ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.3ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.5ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:27.353995"], ["updated_at", "2015-10-26 18:46:27.353995"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:27.356830"], ["updated_at", "2015-10-26 18:46:27.356830"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:27.359333"], ["updated_at", "2015-10-26 18:46:27.359333"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-26 18:46:27.364704"], ["updated_at", "2015-10-26 18:46:27.364704"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 18:46:27.366337"], ["updated_at", "2015-10-26 18:46:27.366337"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 18:46:27.367451"], ["updated_at", "2015-10-26 18:46:27.367451"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.3ms) Rendered products/edit.html.erb within layouts/application (6.5ms) Completed 200 OK in 9ms (Views: 7.6ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-26 18:46:27.392568"], ["updated_at", "2015-10-26 18:46:27.392568"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 18:46:27.413817"], ["updated_at", "2015-10-26 18:46:27.413817"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 18:46:27.416894"], ["updated_at", "2015-10-26 18:46:27.416894"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 18:46:27.420287"], ["updated_at", "2015-10-26 18:46:27.420287"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.3ms) Rendered products/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-26 18:46:27.440396"], ["updated_at", "2015-10-26 18:46:27.440396"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 18:46:27.442293"], ["updated_at", "2015-10-26 18:46:27.442293"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 18:46:27.443618"], ["updated_at", "2015-10-26 18:46:27.443618"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 19:46:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 22:31:23.715135"], ["updated_at", "2015-10-26 22:31:23.715135"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-26 22:31:23.721387"], ["updated_at", "2015-10-26 22:31:23.721387"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-26 22:31:23.723841"], ["updated_at", "2015-10-26 22:31:23.723841"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 23:31:25 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (120.2ms) Rendered categories/edit.html.erb within layouts/application (125.2ms) Completed 200 OK in 430ms (Views: 425.2ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:25 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:25 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-26 23:31:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 22:31:27.089557"], ["id", 3]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:57865/categories Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 22:31:27.156884"], ["updated_at", "2015-10-26 22:31:27.156884"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.0ms) Rendered categories/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-26 23:31:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 22:31:28.270083"], ["updated_at", "2015-10-26 22:31:28.270083"]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:57865/categories Completed 302 Found in 5ms (ActiveRecord: 2.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 22:31:28.330260"], ["updated_at", "2015-10-26 22:31:28.330260"]]  (1.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Rendered categories/new.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-26 22:31:28.351378"], ["updated_at", "2015-10-26 22:31:28.351378"]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 10ms (Views: 9.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-26 22:31:28.379501"], ["updated_at", "2015-10-26 22:31:28.379501"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-26 22:31:28.383044"], ["updated_at", "2015-10-26 22:31:28.383044"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-26 22:31:28.386540"], ["updated_at", "2015-10-26 22:31:28.386540"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (4.7ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.5ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-26 22:31:28.409115"], ["id", 3]]  (1.2ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:28.431563"], ["updated_at", "2015-10-26 22:31:28.431563"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:28.435186"], ["updated_at", "2015-10-26 22:31:28.435186"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:28.438197"], ["updated_at", "2015-10-26 22:31:28.438197"]]  (0.7ms) commit transaction Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.5ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-26 22:31:28.491731"], ["updated_at", "2015-10-26 22:31:28.491731"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 22:31:28.493696"], ["updated_at", "2015-10-26 22:31:28.493696"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 22:31:28.495194"], ["updated_at", "2015-10-26 22:31:28.495194"]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (16.7ms) Rendered products/edit.html.erb within layouts/application (18.9ms) Completed 200 OK in 25ms (Views: 22.8ms | ActiveRecord: 0.8ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-26 22:31:28.546431"], ["updated_at", "2015-10-26 22:31:28.546431"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#index as HTML Product Load (0.3ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:28.570454"], ["updated_at", "2015-10-26 22:31:28.570454"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:28.573472"], ["updated_at", "2015-10-26 22:31:28.573472"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:28.576117"], ["updated_at", "2015-10-26 22:31:28.576117"]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.0ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.2ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-26 22:31:28.599990"], ["updated_at", "2015-10-26 22:31:28.599990"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 22:31:28.601505"], ["updated_at", "2015-10-26 22:31:28.601505"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 22:31:28.602884"], ["updated_at", "2015-10-26 22:31:28.602884"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:28.631465"], ["updated_at", "2015-10-26 22:31:28.631465"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:28.634369"], ["updated_at", "2015-10-26 22:31:28.634369"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:28.637020"], ["updated_at", "2015-10-26 22:31:28.637020"]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.3ms) Rendered products/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:28 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 23:31:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-26 22:31:30.744230"], ["updated_at", "2015-10-26 22:31:30.744230"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 22:31:30.745638"], ["updated_at", "2015-10-26 22:31:30.745638"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 22:31:30.746897"], ["updated_at", "2015-10-26 22:31:30.746897"]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:57865/products Completed 302 Found in 12ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:30.809897"], ["updated_at", "2015-10-26 22:31:30.809897"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:30.812989"], ["updated_at", "2015-10-26 22:31:30.812989"]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:30.815334"], ["updated_at", "2015-10-26 22:31:30.815334"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-26 22:31:30.820970"], ["updated_at", "2015-10-26 22:31:30.820970"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-26 22:31:30.822424"], ["updated_at", "2015-10-26 22:31:30.822424"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-26 22:31:30.823576"], ["updated_at", "2015-10-26 22:31:30.823576"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.3ms) Rendered products/edit.html.erb within layouts/application (6.5ms) Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:30 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 23:31:31 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 23:31:32 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-26 23:31:32 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-26 22:31:32.940516"], ["updated_at", "2015-10-26 22:31:32.940516"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:57865/products Completed 302 Found in 10ms (ActiveRecord: 3.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-26 23:31:32 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.9ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.1ms) Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 1.1ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:32 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:32 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:33.010843"], ["updated_at", "2015-10-26 22:31:33.010843"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:33.014509"], ["updated_at", "2015-10-26 22:31:33.014509"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:33.018408"], ["updated_at", "2015-10-26 22:31:33.018408"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-26 22:31:33.034592"], ["updated_at", "2015-10-26 22:31:33.034592"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 23:31:33 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (31.6ms) Rendered items/edit.html.erb within layouts/application (33.8ms) Completed 200 OK in 40ms (Views: 38.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:33 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:33 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-26 23:31:33 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-26 22:31:34.174823"], ["id", 1]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:57865/items Completed 302 Found in 6ms (ActiveRecord: 3.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:34.242951"], ["updated_at", "2015-10-26 22:31:34.242951"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:34.246156"], ["updated_at", "2015-10-26 22:31:34.246156"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:34.248700"], ["updated_at", "2015-10-26 22:31:34.248700"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.5ms) Rendered items/new.html.erb within layouts/application (7.2ms) Completed 200 OK in 11ms (Views: 9.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-26 23:31:34 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-26 22:31:35.351665"], ["updated_at", "2015-10-26 22:31:35.351665"]]  (3.5ms) commit transaction Redirected to http://127.0.0.1:57865/items Completed 302 Found in 7ms (ActiveRecord: 3.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:35.413590"], ["updated_at", "2015-10-26 22:31:35.413590"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:35.416670"], ["updated_at", "2015-10-26 22:31:35.416670"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:35.419383"], ["updated_at", "2015-10-26 22:31:35.419383"]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-26 22:31:35.422021"], ["updated_at", "2015-10-26 22:31:35.422021"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.5ms) Rendered items/edit.html.erb within layouts/application (5.8ms) Completed 200 OK in 8ms (Views: 6.8ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-26 22:31:35.443312"], ["id", 1]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-26 22:31:35.461523"], ["updated_at", "2015-10-26 22:31:35.461523"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-26 22:31:35.464569"], ["updated_at", "2015-10-26 22:31:35.464569"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-26 22:31:35.467626"], ["updated_at", "2015-10-26 22:31:35.467626"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.7ms) Rendered items/new.html.erb within layouts/application (4.9ms) Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-26 22:31:35.485961"], ["updated_at", "2015-10-26 22:31:35.485961"]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-26 23:31:35 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.0ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:48:35.773130"], ["updated_at", "2015-10-27 11:48:35.773130"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 12:48:35 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (169.0ms) Rendered categories/new.html.erb within layouts/application (191.4ms) Completed 200 OK in 444ms (Views: 443.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 12:48:36 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 11:48:36.261391"], ["updated_at", "2015-10-27 11:48:36.261391"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:48:36 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.8ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:48:36.295008"], ["updated_at", "2015-10-27 11:48:36.295008"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 11:48:36.298863"], ["updated_at", "2015-10-27 11:48:36.298863"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 11:48:36.302386"], ["updated_at", "2015-10-27 11:48:36.302386"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 12:48:36 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.6ms) Rendered categories/edit.html.erb within layouts/application (5.4ms) Completed 200 OK in 15ms (Views: 9.0ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 12:48:36 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 11:48:36.332809"], ["id", 3]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:48:36 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:48:36.352179"], ["updated_at", "2015-10-27 11:48:36.352179"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 12:48:38 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.2ms) Rendered categories/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:38 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:38 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 12:48:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.4ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 11:48:39.669589"], ["updated_at", "2015-10-27 11:48:39.669589"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:61754/categories Completed 302 Found in 6ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:48:39.734841"], ["updated_at", "2015-10-27 11:48:39.734841"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 11:48:39.737824"], ["updated_at", "2015-10-27 11:48:39.737824"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 11:48:39.742321"], ["updated_at", "2015-10-27 11:48:39.742321"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (10.6ms) Rendered categories/edit.html.erb within layouts/application (11.1ms) Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:39 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 12:48:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 12:48:40 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 11:48:40.864115"], ["id", 3]]  (3.7ms) commit transaction Redirected to http://127.0.0.1:61754/categories Completed 302 Found in 8ms (ActiveRecord: 4.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:48:40 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:40 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:40 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:40.934242"], ["updated_at", "2015-10-27 11:48:40.934242"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:40.938788"], ["updated_at", "2015-10-27 11:48:40.938788"]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:40.942010"], ["updated_at", "2015-10-27 11:48:40.942010"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 12:48:40 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (31.8ms) Rendered products/new.html.erb within layouts/application (33.6ms) Completed 200 OK in 52ms (Views: 38.4ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:41 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 12:48:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 12:48:42 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 11:48:43.131338"], ["updated_at", "2015-10-27 11:48:43.131338"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:48:43.133239"], ["updated_at", "2015-10-27 11:48:43.133239"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:48:43.135015"], ["updated_at", "2015-10-27 11:48:43.135015"]]  (3.5ms) commit transaction Redirected to http://127.0.0.1:61754/products Completed 302 Found in 20ms (ActiveRecord: 4.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (13.1ms) Completed 200 OK in 16ms (Views: 15.4ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:43.228636"], ["updated_at", "2015-10-27 11:48:43.228636"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:43.231540"], ["updated_at", "2015-10-27 11:48:43.231540"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:43.234237"], ["updated_at", "2015-10-27 11:48:43.234237"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 11:48:43.240149"], ["updated_at", "2015-10-27 11:48:43.240149"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:48:43.241654"], ["updated_at", "2015-10-27 11:48:43.241654"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:48:43.242784"], ["updated_at", "2015-10-27 11:48:43.242784"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.2ms) Rendered products/edit.html.erb within layouts/application (6.8ms) Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 12:48:43 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 12:48:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 11:48:45.371237"], ["updated_at", "2015-10-27 11:48:45.371237"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:61754/products Completed 302 Found in 11ms (ActiveRecord: 4.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:45.437243"], ["updated_at", "2015-10-27 11:48:45.437243"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:45.440885"], ["updated_at", "2015-10-27 11:48:45.440885"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:45.443789"], ["updated_at", "2015-10-27 11:48:45.443789"]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.3ms) Rendered products/new.html.erb within layouts/application (4.5ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 11:48:45.467961"], ["updated_at", "2015-10-27 11:48:45.467961"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:48:45.470254"], ["updated_at", "2015-10-27 11:48:45.470254"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:48:45.472262"], ["updated_at", "2015-10-27 11:48:45.472262"]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 13ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:45.495845"], ["updated_at", "2015-10-27 11:48:45.495845"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:45.499270"], ["updated_at", "2015-10-27 11:48:45.499270"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:45.502186"], ["updated_at", "2015-10-27 11:48:45.502186"]]  (0.6ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 11:48:45.511960"], ["updated_at", "2015-10-27 11:48:45.511960"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:48:45.515262"], ["updated_at", "2015-10-27 11:48:45.515262"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:48:45.518670"], ["updated_at", "2015-10-27 11:48:45.518670"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (19.0ms) Rendered products/edit.html.erb within layouts/application (20.3ms) Completed 200 OK in 24ms (Views: 22.1ms | ActiveRecord: 0.7ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.5ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 11:48:45.568664"], ["updated_at", "2015-10-27 11:48:45.568664"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 12ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.4ms) Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.4ms) Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:45.599720"], ["updated_at", "2015-10-27 11:48:45.599720"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:45.603762"], ["updated_at", "2015-10-27 11:48:45.603762"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:45.606974"], ["updated_at", "2015-10-27 11:48:45.606974"]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (47.4ms) Rendered items/new.html.erb within layouts/application (49.8ms) Completed 200 OK in 63ms (Views: 54.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:45 +0100 Started GET "/categories/token.json?q=shoes" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 11:48:46.775155"], ["updated_at", "2015-10-27 11:48:46.775155"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:61754/items Completed 302 Found in 7ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:46.844000"], ["updated_at", "2015-10-27 11:48:46.844000"]]  (1.3ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:46.847927"], ["updated_at", "2015-10-27 11:48:46.847927"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:46.852082"], ["updated_at", "2015-10-27 11:48:46.852082"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 11:48:46.856720"], ["updated_at", "2015-10-27 11:48:46.856720"]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.4ms) Rendered items/edit.html.erb within layouts/application (6.5ms) Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:46 +0100 Started GET "/categories/token.json?q=skirt" for 127.0.0.1 at 2015-10-27 12:48:47 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 12:48:47 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 11:48:47.966240"], ["id", 1]]  (2.0ms) commit transaction Redirected to http://127.0.0.1:61754/items Completed 302 Found in 6ms (ActiveRecord: 2.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:48:47 +0100 Processing by ItemsController#index as HTML Item Load (0.4ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:48:47 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:48:47 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:48.035176"], ["updated_at", "2015-10-27 11:48:48.035176"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:48.039623"], ["updated_at", "2015-10-27 11:48:48.039623"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:48.042599"], ["updated_at", "2015-10-27 11:48:48.042599"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 12:48:48 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.8ms) Rendered items/new.html.erb within layouts/application (7.1ms) Completed 200 OK in 10ms (Views: 9.5ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 12:48:48 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 11:48:48.070531"], ["updated_at", "2015-10-27 11:48:48.070531"]]  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:48:48 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.2ms) Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.7ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:48:48.093641"], ["updated_at", "2015-10-27 11:48:48.093641"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:48:48.097548"], ["updated_at", "2015-10-27 11:48:48.097548"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:48:48.100952"], ["updated_at", "2015-10-27 11:48:48.100952"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 11:48:48.104798"], ["updated_at", "2015-10-27 11:48:48.104798"]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 12:48:48 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.5ms) Rendered items/edit.html.erb within layouts/application (7.8ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 12:48:48 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 11:48:48.138974"], ["id", 1]]  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:48:48 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:01.761200"], ["updated_at", "2015-10-27 11:56:01.761200"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:01.769617"], ["updated_at", "2015-10-27 11:56:01.769617"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:01.773308"], ["updated_at", "2015-10-27 11:56:01.773308"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 12:56:01 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (196.3ms) Rendered items/new.html.erb within layouts/application (203.6ms) Completed 200 OK in 459ms (Views: 450.5ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 12:56:02 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 11:56:02.290972"], ["updated_at", "2015-10-27 11:56:02.290972"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 1.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:56:02 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (5.1ms) Completed 200 OK in 9ms (Views: 8.7ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.5ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:02.335225"], ["updated_at", "2015-10-27 11:56:02.335225"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:02.339217"], ["updated_at", "2015-10-27 11:56:02.339217"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:02.342039"], ["updated_at", "2015-10-27 11:56:02.342039"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 11:56:02.345514"], ["updated_at", "2015-10-27 11:56:02.345514"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 12:56:02 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (8.5ms) Rendered items/edit.html.erb within layouts/application (9.4ms) Completed 200 OK in 19ms (Views: 13.1ms | ActiveRecord: 0.5ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 12:56:02 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.6ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 11:56:02.383913"], ["id", 1]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:56:02 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.6ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:02.412999"], ["updated_at", "2015-10-27 11:56:02.412999"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:02.416479"], ["updated_at", "2015-10-27 11:56:02.416479"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:02.420369"], ["updated_at", "2015-10-27 11:56:02.420369"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 11:56:02.423176"], ["updated_at", "2015-10-27 11:56:02.423176"]]  (1.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 12:56:04 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (8.3ms) Rendered items/edit.html.erb within layouts/application (8.7ms) Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:04 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:04 +0100 Started GET "/categories/token.json?q=skirt" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 11:56:05.723158"], ["id", 1]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:61894/items Completed 302 Found in 8ms (ActiveRecord: 3.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:05.793454"], ["updated_at", "2015-10-27 11:56:05.793454"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:05.797033"], ["updated_at", "2015-10-27 11:56:05.797033"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:05.800030"], ["updated_at", "2015-10-27 11:56:05.800030"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (8.1ms) Rendered items/new.html.erb within layouts/application (8.3ms) Completed 200 OK in 12ms (Views: 12.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:05 +0100 Started GET "/categories/token.json?q=shoes" for 127.0.0.1 at 2015-10-27 12:56:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 12:56:06 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 11:56:06.934573"], ["updated_at", "2015-10-27 11:56:06.934573"]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:61894/items Completed 302 Found in 6ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 12:56:06 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:06 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:06 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (1.0ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:56:07.013170"], ["updated_at", "2015-10-27 11:56:07.013170"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 11:56:07.016561"], ["updated_at", "2015-10-27 11:56:07.016561"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 11:56:07.020872"], ["updated_at", "2015-10-27 11:56:07.020872"]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 12:56:07 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (9.2ms) Rendered categories/edit.html.erb within layouts/application (10.9ms) Completed 200 OK in 18ms (Views: 16.3ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:07 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:07 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 12:56:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.4ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 11:56:08.164596"], ["id", 3]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:61894/categories Completed 302 Found in 7ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.9ms) Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.5ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:56:08.240859"], ["updated_at", "2015-10-27 11:56:08.240859"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.2ms) Rendered categories/new.html.erb within layouts/application (3.8ms) Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 12:56:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 11:56:09.350404"], ["updated_at", "2015-10-27 11:56:09.350404"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:61894/categories Completed 302 Found in 7ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Category Load (0.4ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:56:09.417106"], ["updated_at", "2015-10-27 11:56:09.417106"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 11:56:09.420083"], ["updated_at", "2015-10-27 11:56:09.420083"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 11:56:09.422697"], ["updated_at", "2015-10-27 11:56:09.422697"]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.4ms) Rendered categories/edit.html.erb within layouts/application (3.5ms) Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 11:56:09.441755"], ["id", 3]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 11:56:09.465257"], ["updated_at", "2015-10-27 11:56:09.465257"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Rendered categories/new.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 4.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 11:56:09.481705"], ["updated_at", "2015-10-27 11:56:09.481705"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:09.499673"], ["updated_at", "2015-10-27 11:56:09.499673"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:09.502476"], ["updated_at", "2015-10-27 11:56:09.502476"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:09.505396"], ["updated_at", "2015-10-27 11:56:09.505396"]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (22.1ms) Rendered products/new.html.erb within layouts/application (23.9ms) Completed 200 OK in 35ms (Views: 27.6ms | ActiveRecord: 0.4ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 11:56:09.564660"], ["updated_at", "2015-10-27 11:56:09.564660"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:56:09.566511"], ["updated_at", "2015-10-27 11:56:09.566511"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:56:09.567842"], ["updated_at", "2015-10-27 11:56:09.567842"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 16ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (9.8ms) Completed 200 OK in 13ms (Views: 12.1ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:09.599642"], ["updated_at", "2015-10-27 11:56:09.599642"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:09.602501"], ["updated_at", "2015-10-27 11:56:09.602501"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:09.605243"], ["updated_at", "2015-10-27 11:56:09.605243"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 11:56:09.612980"], ["updated_at", "2015-10-27 11:56:09.612980"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:56:09.615872"], ["updated_at", "2015-10-27 11:56:09.615872"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:56:09.617893"], ["updated_at", "2015-10-27 11:56:09.617893"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (8.7ms) Rendered products/edit.html.erb within layouts/application (9.8ms) Completed 200 OK in 15ms (Views: 12.3ms | ActiveRecord: 1.1ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 11:56:09.657264"], ["updated_at", "2015-10-27 11:56:09.657264"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 13ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (4.3ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (13.9ms) DELETE FROM sqlite_sequence where name = 'products';  (3.2ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (5.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.2ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:09.714592"], ["updated_at", "2015-10-27 11:56:09.714592"]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:09.718788"], ["updated_at", "2015-10-27 11:56:09.718788"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:09.722617"], ["updated_at", "2015-10-27 11:56:09.722617"]]  (1.1ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 11:56:09.731164"], ["updated_at", "2015-10-27 11:56:09.731164"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:56:09.733432"], ["updated_at", "2015-10-27 11:56:09.733432"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:56:09.735848"], ["updated_at", "2015-10-27 11:56:09.735848"]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (9.1ms) Rendered products/edit.html.erb within layouts/application (9.4ms) Completed 200 OK in 12ms (Views: 10.6ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:09 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 12:56:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 11:56:11.886685"], ["updated_at", "2015-10-27 11:56:11.886685"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:61894/products Completed 302 Found in 14ms (ActiveRecord: 3.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 11:56:11.958905"], ["updated_at", "2015-10-27 11:56:11.958905"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 11:56:11.961939"], ["updated_at", "2015-10-27 11:56:11.961939"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 11:56:11.965289"], ["updated_at", "2015-10-27 11:56:11.965289"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.4ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:11 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 12:56:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 12:56:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 12:56:14 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 11:56:14.097720"], ["updated_at", "2015-10-27 11:56:14.097720"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 11:56:14.100054"], ["updated_at", "2015-10-27 11:56:14.100054"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 11:56:14.102192"], ["updated_at", "2015-10-27 11:56:14.102192"]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:61894/products Completed 302 Found in 16ms (ActiveRecord: 3.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 12:56:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 12:56:14 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 12:56:14 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (2.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:10.034261"], ["updated_at", "2015-10-27 12:09:10.034261"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:10.042001"], ["updated_at", "2015-10-27 12:09:10.042001"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:10.052814"], ["updated_at", "2015-10-27 12:09:10.052814"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:09:11 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (149.1ms) Rendered items/new.html.erb within layouts/application (153.9ms) Completed 200 OK in 336ms (Views: 324.4ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:11 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:11 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:09:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:09:13.031441"], ["updated_at", "2015-10-27 12:09:13.031441"]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:62181/items Completed 302 Found in 4ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:13.098567"], ["updated_at", "2015-10-27 12:09:13.098567"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:13.101624"], ["updated_at", "2015-10-27 12:09:13.101624"]]  (1.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:13.105164"], ["updated_at", "2015-10-27 12:09:13.105164"]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:09:13.108553"], ["updated_at", "2015-10-27 12:09:13.108553"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.4ms) Rendered items/edit.html.erb within layouts/application (6.0ms) Completed 200 OK in 12ms (Views: 8.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:09:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:09:14.208308"], ["id", 1]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:62181/items Completed 302 Found in 7ms (ActiveRecord: 3.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.4ms) DELETE FROM "categories";  (0.9ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (1.0ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:14.276047"], ["updated_at", "2015-10-27 12:09:14.276047"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:14.279515"], ["updated_at", "2015-10-27 12:09:14.279515"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:14.283520"], ["updated_at", "2015-10-27 12:09:14.283520"]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.5ms) Rendered items/new.html.erb within layouts/application (6.0ms) Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:09:14.313789"], ["updated_at", "2015-10-27 12:09:14.313789"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:14.334717"], ["updated_at", "2015-10-27 12:09:14.334717"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:14.338958"], ["updated_at", "2015-10-27 12:09:14.338958"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:14.342950"], ["updated_at", "2015-10-27 12:09:14.342950"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:09:14.348206"], ["updated_at", "2015-10-27 12:09:14.348206"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (12.2ms) Rendered items/edit.html.erb within layouts/application (12.4ms) Completed 200 OK in 18ms (Views: 17.5ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:09:14.386807"], ["id", 1]]  (1.0ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:09:14.406404"], ["updated_at", "2015-10-27 12:09:14.406404"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 12:09:14.409485"], ["updated_at", "2015-10-27 12:09:14.409485"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 12:09:14.413319"], ["updated_at", "2015-10-27 12:09:14.413319"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (7.4ms) Rendered categories/edit.html.erb within layouts/application (9.3ms) Completed 200 OK in 16ms (Views: 14.4ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:09:14.447024"], ["id", 3]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:09:14.470762"], ["updated_at", "2015-10-27 12:09:14.470762"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.9ms) Rendered categories/new.html.erb within layouts/application (6.8ms) Completed 200 OK in 11ms (Views: 10.7ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:09:14.497131"], ["updated_at", "2015-10-27 12:09:14.497131"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 10ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.3ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:09:14.524100"], ["updated_at", "2015-10-27 12:09:14.524100"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (2.6ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:09:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:09:15.617828"], ["updated_at", "2015-10-27 12:09:15.617828"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62181/categories Completed 302 Found in 6ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:09:15.679977"], ["updated_at", "2015-10-27 12:09:15.679977"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:09:15.682729"], ["updated_at", "2015-10-27 12:09:15.682729"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:09:15.685396"], ["updated_at", "2015-10-27 12:09:15.685396"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.9ms) Rendered categories/edit.html.erb within layouts/application (4.2ms) Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:15 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:09:16.781580"], ["id", 3]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62181/categories Completed 302 Found in 6ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:16.843860"], ["updated_at", "2015-10-27 12:09:16.843860"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:16.847990"], ["updated_at", "2015-10-27 12:09:16.847990"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:16.851422"], ["updated_at", "2015-10-27 12:09:16.851422"]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.7ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:09:16.904002"], ["updated_at", "2015-10-27 12:09:16.904002"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:09:16.906042"], ["updated_at", "2015-10-27 12:09:16.906042"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:09:16.907732"], ["updated_at", "2015-10-27 12:09:16.907732"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (24.7ms) Rendered products/edit.html.erb within layouts/application (27.5ms) Completed 200 OK in 33ms (Views: 31.6ms | ActiveRecord: 0.8ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:09:16.970140"], ["updated_at", "2015-10-27 12:09:16.970140"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:09:16 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (4.8ms) Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:16.997712"], ["updated_at", "2015-10-27 12:09:16.997712"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:17.002186"], ["updated_at", "2015-10-27 12:09:17.002186"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:17.005594"], ["updated_at", "2015-10-27 12:09:17.005594"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (5.5ms) Rendered products/new.html.erb within layouts/application (6.1ms) Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:09:17.035086"], ["updated_at", "2015-10-27 12:09:17.035086"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:09:17.036837"], ["updated_at", "2015-10-27 12:09:17.036837"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:09:17.038371"], ["updated_at", "2015-10-27 12:09:17.038371"]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 13ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:17.060299"], ["updated_at", "2015-10-27 12:09:17.060299"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:17.063091"], ["updated_at", "2015-10-27 12:09:17.063091"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:17.065764"], ["updated_at", "2015-10-27 12:09:17.065764"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:09:17.071065"], ["updated_at", "2015-10-27 12:09:17.071065"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:09:17.072393"], ["updated_at", "2015-10-27 12:09:17.072393"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:09:17.073963"], ["updated_at", "2015-10-27 12:09:17.073963"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (5.9ms) Rendered products/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:09:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:09:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:09:19.190917"], ["updated_at", "2015-10-27 12:09:19.190917"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:62181/products Completed 302 Found in 11ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:09:19.260699"], ["updated_at", "2015-10-27 12:09:19.260699"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:09:19.263421"], ["updated_at", "2015-10-27 12:09:19.263421"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:09:19.265810"], ["updated_at", "2015-10-27 12:09:19.265810"]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.1ms) Rendered products/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:09:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:09:20 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:09:21 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:09:21.377449"], ["updated_at", "2015-10-27 12:09:21.377449"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:09:21.378893"], ["updated_at", "2015-10-27 12:09:21.378893"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:09:21.379967"], ["updated_at", "2015-10-27 12:09:21.379967"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62181/products Completed 302 Found in 12ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:09:21 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:09:21 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:09:21 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:11:59.406115"], ["updated_at", "2015-10-27 12:11:59.406115"]]  (3.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:11:59.414144"], ["updated_at", "2015-10-27 12:11:59.414144"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:11:59.416847"], ["updated_at", "2015-10-27 12:11:59.416847"]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:12:01 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (146.7ms) Rendered products/new.html.erb within layouts/application (151.4ms) Completed 200 OK in 322ms (Views: 314.2ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:01 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:01 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:12:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:12:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:12:03.676284"], ["updated_at", "2015-10-27 12:12:03.676284"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:12:03.678142"], ["updated_at", "2015-10-27 12:12:03.678142"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:12:03.679400"], ["updated_at", "2015-10-27 12:12:03.679400"]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:62235/products Completed 302 Found in 24ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (8.1ms) Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:03.758416"], ["updated_at", "2015-10-27 12:12:03.758416"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:03.761267"], ["updated_at", "2015-10-27 12:12:03.761267"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:03.764149"], ["updated_at", "2015-10-27 12:12:03.764149"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:12:03.770054"], ["updated_at", "2015-10-27 12:12:03.770054"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:12:03.771503"], ["updated_at", "2015-10-27 12:12:03.771503"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:12:03.772651"], ["updated_at", "2015-10-27 12:12:03.772651"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (8.0ms) Rendered products/edit.html.erb within layouts/application (8.7ms) Completed 200 OK in 14ms (Views: 12.2ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:03 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:12:04 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:12:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:12:05 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:12:05.940738"], ["updated_at", "2015-10-27 12:12:05.940738"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:62235/products Completed 302 Found in 13ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:12:05 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:05 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:05 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:06.017511"], ["updated_at", "2015-10-27 12:12:06.017511"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:06.021849"], ["updated_at", "2015-10-27 12:12:06.021849"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:06.024955"], ["updated_at", "2015-10-27 12:12:06.024955"]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:12:06.032456"], ["updated_at", "2015-10-27 12:12:06.032456"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:12:06.033929"], ["updated_at", "2015-10-27 12:12:06.033929"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:12:06.035423"], ["updated_at", "2015-10-27 12:12:06.035423"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (8.1ms) Rendered products/edit.html.erb within layouts/application (9.1ms) Completed 200 OK in 12ms (Views: 10.7ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:12:06.071547"], ["updated_at", "2015-10-27 12:12:06.071547"]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 12ms (ActiveRecord: 1.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.6ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.2ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.8ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:06.100653"], ["updated_at", "2015-10-27 12:12:06.100653"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:06.104710"], ["updated_at", "2015-10-27 12:12:06.104710"]]  (0.9ms) commit transaction  (0.6ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:06.108631"], ["updated_at", "2015-10-27 12:12:06.108631"]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (6.0ms) Rendered products/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:12:06.136026"], ["updated_at", "2015-10-27 12:12:06.136026"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:12:06.137865"], ["updated_at", "2015-10-27 12:12:06.137865"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:12:06.139330"], ["updated_at", "2015-10-27 12:12:06.139330"]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:06.161799"], ["updated_at", "2015-10-27 12:12:06.161799"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:06.165023"], ["updated_at", "2015-10-27 12:12:06.165023"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:06.167700"], ["updated_at", "2015-10-27 12:12:06.167700"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:12:06.188883"], ["updated_at", "2015-10-27 12:12:06.188883"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.5ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (29.0ms) Rendered items/edit.html.erb within layouts/application (30.5ms) Completed 200 OK in 37ms (Views: 34.2ms | ActiveRecord: 0.6ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:12:06.247869"], ["id", 1]]  (2.4ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 8ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.3ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:06.275145"], ["updated_at", "2015-10-27 12:12:06.275145"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:06.278717"], ["updated_at", "2015-10-27 12:12:06.278717"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:06.282072"], ["updated_at", "2015-10-27 12:12:06.282072"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.5ms) Rendered items/new.html.erb within layouts/application (8.4ms) Completed 200 OK in 13ms (Views: 12.2ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:12:06.309554"], ["updated_at", "2015-10-27 12:12:06.309554"]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:06.328735"], ["updated_at", "2015-10-27 12:12:06.328735"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:06.331512"], ["updated_at", "2015-10-27 12:12:06.331512"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:06.334611"], ["updated_at", "2015-10-27 12:12:06.334611"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:12:06.337639"], ["updated_at", "2015-10-27 12:12:06.337639"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.8ms) Rendered items/edit.html.erb within layouts/application (6.0ms) Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:12:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:12:07.446044"], ["id", 1]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:62235/items Completed 302 Found in 7ms (ActiveRecord: 3.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:12:07.520321"], ["updated_at", "2015-10-27 12:12:07.520321"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:12:07.524002"], ["updated_at", "2015-10-27 12:12:07.524002"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:12:07.527146"], ["updated_at", "2015-10-27 12:12:07.527146"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.4ms) Rendered items/new.html.erb within layouts/application (6.6ms) Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:12:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (1.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:12:08.637265"], ["updated_at", "2015-10-27 12:12:08.637265"]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:62235/items Completed 302 Found in 6ms (ActiveRecord: 4.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:12:08.707696"], ["updated_at", "2015-10-27 12:12:08.707696"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.8ms) Rendered categories/new.html.erb within layouts/application (6.6ms) Completed 200 OK in 11ms (Views: 10.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:08 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:12:09.819677"], ["updated_at", "2015-10-27 12:12:09.819677"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62235/categories Completed 302 Found in 6ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 7ms (Views: 5.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.6ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:12:09.900010"], ["updated_at", "2015-10-27 12:12:09.900010"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:12:09.903155"], ["updated_at", "2015-10-27 12:12:09.903155"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:12:09.905964"], ["updated_at", "2015-10-27 12:12:09.905964"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (10.0ms) Rendered categories/edit.html.erb within layouts/application (10.6ms) Completed 200 OK in 14ms (Views: 12.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:09 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:12:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:12:11.020316"], ["id", 3]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:62235/categories Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:12:11.078626"], ["updated_at", "2015-10-27 12:12:11.078626"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:12:11.081305"], ["updated_at", "2015-10-27 12:12:11.081305"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:12:11.083665"], ["updated_at", "2015-10-27 12:12:11.083665"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.3ms) Rendered categories/edit.html.erb within layouts/application (3.5ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:12:11.101582"], ["id", 3]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.3ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:12:11.121121"], ["updated_at", "2015-10-27 12:12:11.121121"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Rendered categories/new.html.erb within layouts/application (2.9ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:12:11.139114"], ["updated_at", "2015-10-27 12:12:11.139114"]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:12:11 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:18.620187"], ["updated_at", "2015-10-27 12:22:18.620187"]]  (2.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:18.627782"], ["updated_at", "2015-10-27 12:22:18.627782"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:18.630769"], ["updated_at", "2015-10-27 12:22:18.630769"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:22:20 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (151.8ms) Rendered items/new.html.erb within layouts/application (156.8ms) Completed 200 OK in 335ms (Views: 324.5ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:20 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:20 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:22:21 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:22:22.031801"], ["updated_at", "2015-10-27 12:22:22.031801"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:62419/items Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:22.100822"], ["updated_at", "2015-10-27 12:22:22.100822"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:22.103603"], ["updated_at", "2015-10-27 12:22:22.103603"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:22.106284"], ["updated_at", "2015-10-27 12:22:22.106284"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:22:22.109838"], ["updated_at", "2015-10-27 12:22:22.109838"]]  (0.8ms) commit transaction Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.8ms) Rendered items/edit.html.erb within layouts/application (6.6ms) Completed 200 OK in 13ms (Views: 8.9ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:22:22 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:22:23.209735"], ["id", 1]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:62419/items Completed 302 Found in 6ms (ActiveRecord: 2.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (2.6ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:23.304577"], ["updated_at", "2015-10-27 12:22:23.304577"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:23.308805"], ["updated_at", "2015-10-27 12:22:23.308805"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:23.311963"], ["updated_at", "2015-10-27 12:22:23.311963"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.0ms) Rendered items/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 8ms (Views: 7.7ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:22:23.340429"], ["updated_at", "2015-10-27 12:22:23.340429"]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:23.360333"], ["updated_at", "2015-10-27 12:22:23.360333"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:23.363776"], ["updated_at", "2015-10-27 12:22:23.363776"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:23.367491"], ["updated_at", "2015-10-27 12:22:23.367491"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:22:23.371650"], ["updated_at", "2015-10-27 12:22:23.371650"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (8.2ms) Rendered items/edit.html.erb within layouts/application (8.4ms) Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:22:23.405604"], ["id", 1]]  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by ItemsController#index as HTML Item Load (0.7ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.7ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:22:23.426501"], ["updated_at", "2015-10-27 12:22:23.426501"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (6.1ms) Rendered categories/new.html.erb within layouts/application (8.4ms) Completed 200 OK in 13ms (Views: 12.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:22:23 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:22:24.546613"], ["updated_at", "2015-10-27 12:22:24.546613"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:62419/categories Completed 302 Found in 9ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (5.2ms) Completed 200 OK in 11ms (Views: 10.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.6ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.3ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:22:24.647560"], ["updated_at", "2015-10-27 12:22:24.647560"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:22:24.651773"], ["updated_at", "2015-10-27 12:22:24.651773"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:22:24.655420"], ["updated_at", "2015-10-27 12:22:24.655420"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.5ms) Rendered categories/edit.html.erb within layouts/application (4.1ms) Completed 200 OK in 8ms (Views: 6.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:24 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:22:25.776173"], ["id", 3]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:62419/categories Completed 302 Found in 7ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:22:25.835339"], ["updated_at", "2015-10-27 12:22:25.835339"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Rendered categories/new.html.erb within layouts/application (3.0ms) Completed 200 OK in 4ms (Views: 4.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:22:25.852850"], ["updated_at", "2015-10-27 12:22:25.852850"]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:22:25.880182"], ["updated_at", "2015-10-27 12:22:25.880182"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:22:25.883317"], ["updated_at", "2015-10-27 12:22:25.883317"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:22:25.885992"], ["updated_at", "2015-10-27 12:22:25.885992"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.7ms) Rendered categories/edit.html.erb within layouts/application (3.9ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:22:25.903818"], ["id", 3]]  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:25.920171"], ["updated_at", "2015-10-27 12:22:25.920171"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:25.922996"], ["updated_at", "2015-10-27 12:22:25.922996"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:25.925548"], ["updated_at", "2015-10-27 12:22:25.925548"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:22:25.957586"], ["updated_at", "2015-10-27 12:22:25.957586"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:22:25.959372"], ["updated_at", "2015-10-27 12:22:25.959372"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:22:25.960881"], ["updated_at", "2015-10-27 12:22:25.960881"]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (14.6ms) Rendered products/edit.html.erb within layouts/application (16.1ms) Completed 200 OK in 21ms (Views: 19.0ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:25 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:26 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:22:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:22:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.3ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:22:28.099926"], ["updated_at", "2015-10-27 12:22:28.099926"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:62419/products Completed 302 Found in 14ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.6ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:28.178364"], ["updated_at", "2015-10-27 12:22:28.178364"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:28.182231"], ["updated_at", "2015-10-27 12:22:28.182231"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:28.185267"], ["updated_at", "2015-10-27 12:22:28.185267"]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (5.8ms) Rendered products/new.html.erb within layouts/application (7.0ms) Completed 200 OK in 11ms (Views: 10.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:22:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:22:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:22:30.309858"], ["updated_at", "2015-10-27 12:22:30.309858"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:22:30.311552"], ["updated_at", "2015-10-27 12:22:30.311552"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:22:30.313216"], ["updated_at", "2015-10-27 12:22:30.313216"]]  (3.6ms) commit transaction Redirected to http://127.0.0.1:62419/products Completed 302 Found in 14ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:30.381733"], ["updated_at", "2015-10-27 12:22:30.381733"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:30.385445"], ["updated_at", "2015-10-27 12:22:30.385445"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:30.393138"], ["updated_at", "2015-10-27 12:22:30.393138"]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:22:30.400167"], ["updated_at", "2015-10-27 12:22:30.400167"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:22:30.401562"], ["updated_at", "2015-10-27 12:22:30.401562"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:22:30.402941"], ["updated_at", "2015-10-27 12:22:30.402941"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (7.4ms) Rendered products/edit.html.erb within layouts/application (8.0ms) Completed 200 OK in 10ms (Views: 9.1ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:22:30.433114"], ["updated_at", "2015-10-27 12:22:30.433114"]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:22:30.456121"], ["updated_at", "2015-10-27 12:22:30.456121"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (1.0ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:22:30.459533"], ["updated_at", "2015-10-27 12:22:30.459533"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:22:30.463412"], ["updated_at", "2015-10-27 12:22:30.463412"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (8.0ms) Rendered products/new.html.erb within layouts/application (8.3ms) Completed 200 OK in 10ms (Views: 9.7ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:22:30.489379"], ["updated_at", "2015-10-27 12:22:30.489379"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:22:30.491278"], ["updated_at", "2015-10-27 12:22:30.491278"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:22:30.492856"], ["updated_at", "2015-10-27 12:22:30.492856"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:22:30 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:42.241985"], ["updated_at", "2015-10-27 12:24:42.241985"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:42.247820"], ["updated_at", "2015-10-27 12:24:42.247820"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:42.250639"], ["updated_at", "2015-10-27 12:24:42.250639"]]  (1.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:24:42.295431"], ["updated_at", "2015-10-27 12:24:42.295431"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:24:42.297065"], ["updated_at", "2015-10-27 12:24:42.297065"]] SQL (0.0ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:24:42.298223"], ["updated_at", "2015-10-27 12:24:42.298223"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:24:44 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (143.5ms) Rendered products/edit.html.erb within layouts/application (148.8ms) Completed 200 OK in 313ms (Views: 308.0ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:44 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:44 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:24:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:24:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:24:46.492065"], ["updated_at", "2015-10-27 12:24:46.492065"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62448/products Completed 302 Found in 12ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:46.556302"], ["updated_at", "2015-10-27 12:24:46.556302"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:46.559153"], ["updated_at", "2015-10-27 12:24:46.559153"]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:46.561681"], ["updated_at", "2015-10-27 12:24:46.561681"]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (5.4ms) Rendered products/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 9ms (Views: 9.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:24:46 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:24:47 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:24:48.682378"], ["updated_at", "2015-10-27 12:24:48.682378"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:24:48.684216"], ["updated_at", "2015-10-27 12:24:48.684216"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:24:48.686098"], ["updated_at", "2015-10-27 12:24:48.686098"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:62448/products Completed 302 Found in 15ms (ActiveRecord: 4.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (4.5ms) Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (2.5ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (2.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:48.791852"], ["updated_at", "2015-10-27 12:24:48.791852"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:48.796143"], ["updated_at", "2015-10-27 12:24:48.796143"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:48.800378"], ["updated_at", "2015-10-27 12:24:48.800378"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (6.6ms) Rendered products/new.html.erb within layouts/application (6.9ms) Completed 200 OK in 11ms (Views: 9.9ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:24:48.838372"], ["updated_at", "2015-10-27 12:24:48.838372"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:24:48.841005"], ["updated_at", "2015-10-27 12:24:48.841005"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:24:48.849223"], ["updated_at", "2015-10-27 12:24:48.849223"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 25ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.3ms) Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.7ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (1.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:48.889678"], ["updated_at", "2015-10-27 12:24:48.889678"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:48.893358"], ["updated_at", "2015-10-27 12:24:48.893358"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:48.896963"], ["updated_at", "2015-10-27 12:24:48.896963"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:24:48.905506"], ["updated_at", "2015-10-27 12:24:48.905506"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:24:48.906924"], ["updated_at", "2015-10-27 12:24:48.906924"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:24:48.908478"], ["updated_at", "2015-10-27 12:24:48.908478"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (7.2ms) Rendered products/edit.html.erb within layouts/application (7.4ms) Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:24:48.938975"], ["updated_at", "2015-10-27 12:24:48.938975"]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.4ms) Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:48.967027"], ["updated_at", "2015-10-27 12:24:48.967027"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:48.970690"], ["updated_at", "2015-10-27 12:24:48.970690"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:48.973743"], ["updated_at", "2015-10-27 12:24:48.973743"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:24:48 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (31.1ms) Rendered items/new.html.erb within layouts/application (32.5ms) Completed 200 OK in 46ms (Views: 36.6ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:24:49.038533"], ["updated_at", "2015-10-27 12:24:49.038533"]]  (2.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:49.061442"], ["updated_at", "2015-10-27 12:24:49.061442"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:49.065089"], ["updated_at", "2015-10-27 12:24:49.065089"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:49.067812"], ["updated_at", "2015-10-27 12:24:49.067812"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:24:49.070977"], ["updated_at", "2015-10-27 12:24:49.070977"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.3ms) Rendered items/edit.html.erb within layouts/application (6.1ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:24:49.094026"], ["id", 1]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:49.111103"], ["updated_at", "2015-10-27 12:24:49.111103"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:49.114278"], ["updated_at", "2015-10-27 12:24:49.114278"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:49.117289"], ["updated_at", "2015-10-27 12:24:49.117289"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.7ms) Rendered items/new.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:24:49 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:24:50.210677"], ["updated_at", "2015-10-27 12:24:50.210677"]]  (3.4ms) commit transaction Redirected to http://127.0.0.1:62448/items Completed 302 Found in 7ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:24:50.283879"], ["updated_at", "2015-10-27 12:24:50.283879"]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:24:50.287211"], ["updated_at", "2015-10-27 12:24:50.287211"]]  (0.9ms) commit transaction  (0.4ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:24:50.290704"], ["updated_at", "2015-10-27 12:24:50.290704"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:24:50.293840"], ["updated_at", "2015-10-27 12:24:50.293840"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (8.0ms) Rendered items/edit.html.erb within layouts/application (8.3ms) Completed 200 OK in 11ms (Views: 9.7ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:24:50 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:24:51.402037"], ["id", 1]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62448/items Completed 302 Found in 7ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:24:51.473358"], ["updated_at", "2015-10-27 12:24:51.473358"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:24:51.477231"], ["updated_at", "2015-10-27 12:24:51.477231"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:24:51.481595"], ["updated_at", "2015-10-27 12:24:51.481595"]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (5.9ms) Rendered categories/edit.html.erb within layouts/application (7.6ms) Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:24:51 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.4ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:24:52.592752"], ["id", 3]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62448/categories Completed 302 Found in 6ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 12ms (Views: 11.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:24:52.659159"], ["updated_at", "2015-10-27 12:24:52.659159"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (3.0ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:52 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:24:53.758466"], ["updated_at", "2015-10-27 12:24:53.758466"]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:62448/categories Completed 302 Found in 6ms (ActiveRecord: 3.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:24:53.825903"], ["updated_at", "2015-10-27 12:24:53.825903"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:24:53.828996"], ["updated_at", "2015-10-27 12:24:53.828996"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:24:53.831637"], ["updated_at", "2015-10-27 12:24:53.831637"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.3ms) Rendered categories/edit.html.erb within layouts/application (3.5ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:24:53.848937"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (6.4ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:24:53.872132"], ["updated_at", "2015-10-27 12:24:53.872132"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.8ms) Rendered categories/new.html.erb within layouts/application (4.1ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:24:53.894356"], ["updated_at", "2015-10-27 12:24:53.894356"]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:24:53 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.3ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (11.5ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:37:07.619500"], ["updated_at", "2015-10-27 12:37:07.619500"]]  (3.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:37:07.627359"], ["updated_at", "2015-10-27 12:37:07.627359"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:37:07.630527"], ["updated_at", "2015-10-27 12:37:07.630527"]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:37:09 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (118.3ms) Rendered categories/edit.html.erb within layouts/application (123.0ms) Completed 200 OK in 415ms (Views: 410.3ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:09 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.6ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:37:10.864310"], ["id", 3]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62633/categories Completed 302 Found in 8ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:37:10.930696"], ["updated_at", "2015-10-27 12:37:10.930696"]]  (0.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (5.5ms) Rendered categories/new.html.erb within layouts/application (6.7ms) Completed 200 OK in 12ms (Views: 11.2ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:10 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:37:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:37:12.053590"], ["updated_at", "2015-10-27 12:37:12.053590"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62633/categories Completed 302 Found in 8ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.7ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (2.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.9ms) DELETE FROM "products";  (0.7ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.9ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:37:12.154002"], ["updated_at", "2015-10-27 12:37:12.154002"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (6.0ms) Rendered categories/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 10ms (Views: 10.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:37:12.183289"], ["updated_at", "2015-10-27 12:37:12.183289"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:37:12.208176"], ["updated_at", "2015-10-27 12:37:12.208176"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:37:12.211555"], ["updated_at", "2015-10-27 12:37:12.211555"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:37:12.214304"], ["updated_at", "2015-10-27 12:37:12.214304"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.7ms) Rendered categories/edit.html.erb within layouts/application (3.9ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:37:12.234438"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:12.258601"], ["updated_at", "2015-10-27 12:37:12.258601"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:12.261419"], ["updated_at", "2015-10-27 12:37:12.261419"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:12.264043"], ["updated_at", "2015-10-27 12:37:12.264043"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:37:12.271654"], ["updated_at", "2015-10-27 12:37:12.271654"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (19.7ms) Rendered items/edit.html.erb within layouts/application (21.2ms) Completed 200 OK in 26ms (Views: 24.2ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:37:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:37:13.393671"], ["id", 1]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:62633/items Completed 302 Found in 6ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:13.454895"], ["updated_at", "2015-10-27 12:37:13.454895"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:13.457513"], ["updated_at", "2015-10-27 12:37:13.457513"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:13.459898"], ["updated_at", "2015-10-27 12:37:13.459898"]]  (1.2ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.9ms) Rendered items/new.html.erb within layouts/application (4.5ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:37:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:37:14.557210"], ["updated_at", "2015-10-27 12:37:14.557210"]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:62633/items Completed 302 Found in 5ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:14.618089"], ["updated_at", "2015-10-27 12:37:14.618089"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:14.621070"], ["updated_at", "2015-10-27 12:37:14.621070"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:14.623574"], ["updated_at", "2015-10-27 12:37:14.623574"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.0ms) Rendered items/new.html.erb within layouts/application (4.2ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:37:14.641182"], ["updated_at", "2015-10-27 12:37:14.641182"]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:14.658482"], ["updated_at", "2015-10-27 12:37:14.658482"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:14.661080"], ["updated_at", "2015-10-27 12:37:14.661080"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:14.663532"], ["updated_at", "2015-10-27 12:37:14.663532"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:37:14.666090"], ["updated_at", "2015-10-27 12:37:14.666090"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.5ms) Rendered items/edit.html.erb within layouts/application (6.7ms) Completed 200 OK in 8ms (Views: 7.7ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:37:14.685884"], ["id", 1]]  (1.0ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:14.702009"], ["updated_at", "2015-10-27 12:37:14.702009"]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:14.705014"], ["updated_at", "2015-10-27 12:37:14.705014"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:14.707887"], ["updated_at", "2015-10-27 12:37:14.707887"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (17.4ms) Rendered products/new.html.erb within layouts/application (18.9ms) Completed 200 OK in 28ms (Views: 22.1ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:37:14.759605"], ["updated_at", "2015-10-27 12:37:14.759605"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:37:14.761208"], ["updated_at", "2015-10-27 12:37:14.761208"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:37:14.762385"], ["updated_at", "2015-10-27 12:37:14.762385"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 16ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (8.2ms) Completed 200 OK in 11ms (Views: 10.2ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:14.792695"], ["updated_at", "2015-10-27 12:37:14.792695"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:14.795424"], ["updated_at", "2015-10-27 12:37:14.795424"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:14.797841"], ["updated_at", "2015-10-27 12:37:14.797841"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:37:14.803547"], ["updated_at", "2015-10-27 12:37:14.803547"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:37:14.804909"], ["updated_at", "2015-10-27 12:37:14.804909"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:37:14.806164"], ["updated_at", "2015-10-27 12:37:14.806164"]]  (0.7ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (5.9ms) Rendered products/edit.html.erb within layouts/application (6.5ms) Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.7ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:37:14.832255"], ["updated_at", "2015-10-27 12:37:14.832255"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:14.852220"], ["updated_at", "2015-10-27 12:37:14.852220"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:14.855050"], ["updated_at", "2015-10-27 12:37:14.855050"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:14.858253"], ["updated_at", "2015-10-27 12:37:14.858253"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.5ms) Rendered products/new.html.erb within layouts/application (3.7ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:14 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:37:15 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:37:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:37:16 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:37:16.992225"], ["updated_at", "2015-10-27 12:37:16.992225"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:37:16.993754"], ["updated_at", "2015-10-27 12:37:16.993754"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:37:16.995048"], ["updated_at", "2015-10-27 12:37:16.995048"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62633/products Completed 302 Found in 14ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:37:17.061248"], ["updated_at", "2015-10-27 12:37:17.061248"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:37:17.064035"], ["updated_at", "2015-10-27 12:37:17.064035"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:37:17.066691"], ["updated_at", "2015-10-27 12:37:17.066691"]]  (0.7ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:37:17.072582"], ["updated_at", "2015-10-27 12:37:17.072582"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:37:17.074324"], ["updated_at", "2015-10-27 12:37:17.074324"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:37:17.075651"], ["updated_at", "2015-10-27 12:37:17.075651"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (5.1ms) Rendered products/edit.html.erb within layouts/application (5.3ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:37:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:37:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:37:19 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:37:19.199947"], ["updated_at", "2015-10-27 12:37:19.199947"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:62633/products Completed 302 Found in 10ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:37:19 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.1ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:37:19 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:37:19 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:34.825025"], ["updated_at", "2015-10-27 12:40:34.825025"]]  (3.2ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:34.832927"], ["updated_at", "2015-10-27 12:40:34.832927"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:34.835411"], ["updated_at", "2015-10-27 12:40:34.835411"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:40:34.844256"], ["updated_at", "2015-10-27 12:40:34.844256"]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:40:36 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (143.6ms) Rendered items/edit.html.erb within layouts/application (148.3ms) Completed 200 OK in 324ms (Views: 319.2ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:36 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:36 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:40:37 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:40:38.020061"], ["id", 1]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:62748/items Completed 302 Found in 8ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:38.092144"], ["updated_at", "2015-10-27 12:40:38.092144"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:38.095269"], ["updated_at", "2015-10-27 12:40:38.095269"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:38.097780"], ["updated_at", "2015-10-27 12:40:38.097780"]]  (1.1ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.1ms) Rendered items/new.html.erb within layouts/application (5.7ms) Completed 200 OK in 8ms (Views: 8.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:40:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:40:39.200065"], ["updated_at", "2015-10-27 12:40:39.200065"]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:62748/items Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:39.276440"], ["updated_at", "2015-10-27 12:40:39.276440"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:39.279470"], ["updated_at", "2015-10-27 12:40:39.279470"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:39.282252"], ["updated_at", "2015-10-27 12:40:39.282252"]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.8ms) Rendered items/new.html.erb within layouts/application (6.0ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:40:39.307970"], ["updated_at", "2015-10-27 12:40:39.307970"]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:39.331328"], ["updated_at", "2015-10-27 12:40:39.331328"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:39.339073"], ["updated_at", "2015-10-27 12:40:39.339073"]]  (0.8ms) commit transaction  (0.8ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:39.343115"], ["updated_at", "2015-10-27 12:40:39.343115"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:40:39.346800"], ["updated_at", "2015-10-27 12:40:39.346800"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (12.7ms) Rendered items/edit.html.erb within layouts/application (12.9ms) Completed 200 OK in 16ms (Views: 15.4ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:40:39.379840"], ["id", 1]]  (1.1ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ItemsController#index as HTML Item Load (0.5ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.5ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:39.401496"], ["updated_at", "2015-10-27 12:40:39.401496"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:39.405170"], ["updated_at", "2015-10-27 12:40:39.405170"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:39.408747"], ["updated_at", "2015-10-27 12:40:39.408747"]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:40:39.455794"], ["updated_at", "2015-10-27 12:40:39.455794"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:39.457797"], ["updated_at", "2015-10-27 12:40:39.457797"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:39.459754"], ["updated_at", "2015-10-27 12:40:39.459754"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (20.7ms) Rendered products/edit.html.erb within layouts/application (22.1ms) Completed 200 OK in 27ms (Views: 24.9ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:40:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:40:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:40:41.624144"], ["updated_at", "2015-10-27 12:40:41.624144"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:62748/products Completed 302 Found in 18ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:41.686896"], ["updated_at", "2015-10-27 12:40:41.686896"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:41.689906"], ["updated_at", "2015-10-27 12:40:41.689906"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:41.692593"], ["updated_at", "2015-10-27 12:40:41.692593"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.6ms) Rendered products/new.html.erb within layouts/application (4.2ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:41 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:40:42 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:40:43.817903"], ["updated_at", "2015-10-27 12:40:43.817903"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:43.819947"], ["updated_at", "2015-10-27 12:40:43.819947"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:43.821439"], ["updated_at", "2015-10-27 12:40:43.821439"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62748/products Completed 302 Found in 13ms (ActiveRecord: 4.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:43.888513"], ["updated_at", "2015-10-27 12:40:43.888513"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:43.891377"], ["updated_at", "2015-10-27 12:40:43.891377"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:43.894050"], ["updated_at", "2015-10-27 12:40:43.894050"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.7ms) Rendered products/new.html.erb within layouts/application (3.9ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:40:43.915034"], ["updated_at", "2015-10-27 12:40:43.915034"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:43.916581"], ["updated_at", "2015-10-27 12:40:43.916581"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:43.917870"], ["updated_at", "2015-10-27 12:40:43.917870"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.3ms) Product Load (0.6ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:43.944157"], ["updated_at", "2015-10-27 12:40:43.944157"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:43.948497"], ["updated_at", "2015-10-27 12:40:43.948497"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:43.957008"], ["updated_at", "2015-10-27 12:40:43.957008"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:40:43.964286"], ["updated_at", "2015-10-27 12:40:43.964286"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:43.965778"], ["updated_at", "2015-10-27 12:40:43.965778"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:43.967637"], ["updated_at", "2015-10-27 12:40:43.967637"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (7.9ms) Rendered products/edit.html.erb within layouts/application (8.1ms) Completed 200 OK in 12ms (Views: 10.6ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:40:43 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:40:44.001096"], ["updated_at", "2015-10-27 12:40:44.001096"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:44 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:40:44.029155"], ["updated_at", "2015-10-27 12:40:44.029155"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:40:44 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.8ms) Rendered categories/new.html.erb within layouts/application (6.4ms) Completed 200 OK in 12ms (Views: 11.7ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:44 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:44 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:40:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 1.1ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:40:45.144214"], ["updated_at", "2015-10-27 12:40:45.144214"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:62748/categories Completed 302 Found in 6ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (4.1ms) Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:40:45.217602"], ["updated_at", "2015-10-27 12:40:45.217602"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:40:45.221966"], ["updated_at", "2015-10-27 12:40:45.221966"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:40:45.226565"], ["updated_at", "2015-10-27 12:40:45.226565"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.9ms) Rendered categories/edit.html.erb within layouts/application (4.8ms) Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:40:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:40:46.344135"], ["id", 3]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62748/categories Completed 302 Found in 14ms (ActiveRecord: 3.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:40:46.408760"], ["updated_at", "2015-10-27 12:40:46.408760"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:40:46.411220"], ["updated_at", "2015-10-27 12:40:46.411220"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:40:46.413611"], ["updated_at", "2015-10-27 12:40:46.413611"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.4ms) Rendered categories/edit.html.erb within layouts/application (3.6ms) Completed 200 OK in 6ms (Views: 4.8ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:40:46.431434"], ["id", 3]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:40:46.447155"], ["updated_at", "2015-10-27 12:40:46.447155"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.3ms) Rendered categories/new.html.erb within layouts/application (2.5ms) Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:40:46.462472"], ["updated_at", "2015-10-27 12:40:46.462472"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:40:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:51.487914"], ["updated_at", "2015-10-27 12:40:51.487914"]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:51.495602"], ["updated_at", "2015-10-27 12:40:51.495602"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:51.498051"], ["updated_at", "2015-10-27 12:40:51.498051"]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:40:51 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (128.8ms) Rendered products/new.html.erb within layouts/application (133.1ms) Completed 200 OK in 286ms (Views: 278.7ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:40:51 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:40:51.824224"], ["updated_at", "2015-10-27 12:40:51.824224"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:51.825774"], ["updated_at", "2015-10-27 12:40:51.825774"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:51.826911"], ["updated_at", "2015-10-27 12:40:51.826911"]]  (3.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 23ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:51 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (8.8ms) Completed 200 OK in 11ms (Views: 10.6ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:51.861220"], ["updated_at", "2015-10-27 12:40:51.861220"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:51.863674"], ["updated_at", "2015-10-27 12:40:51.863674"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:51.887690"], ["updated_at", "2015-10-27 12:40:51.887690"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:40:51.893625"], ["updated_at", "2015-10-27 12:40:51.893625"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:51.895198"], ["updated_at", "2015-10-27 12:40:51.895198"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:51.896395"], ["updated_at", "2015-10-27 12:40:51.896395"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:40:51 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (5.8ms) Rendered products/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 10ms (Views: 8.4ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:40:51 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:40:51.923044"], ["updated_at", "2015-10-27 12:40:51.923044"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:51 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:51.943874"], ["updated_at", "2015-10-27 12:40:51.943874"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:51.947082"], ["updated_at", "2015-10-27 12:40:51.947082"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:51.949597"], ["updated_at", "2015-10-27 12:40:51.949597"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:40:53 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (6.0ms) Rendered products/new.html.erb within layouts/application (6.3ms) Completed 200 OK in 8ms (Views: 7.7ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:53 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:53 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:40:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:40:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:40:55.636870"], ["updated_at", "2015-10-27 12:40:55.636870"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:55.640046"], ["updated_at", "2015-10-27 12:40:55.640046"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:55.650543"], ["updated_at", "2015-10-27 12:40:55.650543"]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:62762/products Completed 302 Found in 29ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (4.6ms) Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:55.733744"], ["updated_at", "2015-10-27 12:40:55.733744"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:55.737717"], ["updated_at", "2015-10-27 12:40:55.737717"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:55.740897"], ["updated_at", "2015-10-27 12:40:55.740897"]]  (0.8ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:40:55.748877"], ["updated_at", "2015-10-27 12:40:55.748877"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:40:55.750844"], ["updated_at", "2015-10-27 12:40:55.750844"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:40:55.752634"], ["updated_at", "2015-10-27 12:40:55.752634"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (9.4ms) Rendered products/edit.html.erb within layouts/application (9.6ms) Completed 200 OK in 13ms (Views: 11.0ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:55 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:40:56 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:40:57 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:40:57 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (1.0ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:40:57.889986"], ["updated_at", "2015-10-27 12:40:57.889986"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62762/products Completed 302 Found in 14ms (ActiveRecord: 4.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:40:57 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:57 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:57 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:57.956658"], ["updated_at", "2015-10-27 12:40:57.956658"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:57.961393"], ["updated_at", "2015-10-27 12:40:57.961393"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:57.964940"], ["updated_at", "2015-10-27 12:40:57.964940"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:40:57.978583"], ["updated_at", "2015-10-27 12:40:57.978583"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:40:57 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (28.5ms) Rendered items/edit.html.erb within layouts/application (30.1ms) Completed 200 OK in 35ms (Views: 33.6ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:40:58.036304"], ["id", 1]]  (2.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 8ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.7ms) Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:58.068739"], ["updated_at", "2015-10-27 12:40:58.068739"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:58.071800"], ["updated_at", "2015-10-27 12:40:58.071800"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:58.074483"], ["updated_at", "2015-10-27 12:40:58.074483"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.6ms) Rendered items/new.html.erb within layouts/application (5.2ms) Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:40:58.094705"], ["updated_at", "2015-10-27 12:40:58.094705"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:58.114228"], ["updated_at", "2015-10-27 12:40:58.114228"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:58.117713"], ["updated_at", "2015-10-27 12:40:58.117713"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:58.120309"], ["updated_at", "2015-10-27 12:40:58.120309"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.5ms) Rendered items/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:40:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:40:59.223266"], ["updated_at", "2015-10-27 12:40:59.223266"]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:62762/items Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:40:59.282920"], ["updated_at", "2015-10-27 12:40:59.282920"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:40:59.286060"], ["updated_at", "2015-10-27 12:40:59.286060"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:40:59.288718"], ["updated_at", "2015-10-27 12:40:59.288718"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:40:59.291477"], ["updated_at", "2015-10-27 12:40:59.291477"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.9ms) Rendered items/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:40:59 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:41:00.407399"], ["id", 1]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:62762/items Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:41:00.485050"], ["updated_at", "2015-10-27 12:41:00.485050"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (9.9ms) Rendered categories/new.html.erb within layouts/application (12.6ms) Completed 200 OK in 20ms (Views: 19.3ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:41:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:41:01.613758"], ["updated_at", "2015-10-27 12:41:01.613758"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62762/categories Completed 302 Found in 6ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (8.1ms) Completed 200 OK in 11ms (Views: 10.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:41:01.690261"], ["updated_at", "2015-10-27 12:41:01.690261"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:41:01.693776"], ["updated_at", "2015-10-27 12:41:01.693776"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:41:01.696771"], ["updated_at", "2015-10-27 12:41:01.696771"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (5.1ms) Rendered categories/edit.html.erb within layouts/application (5.6ms) Completed 200 OK in 10ms (Views: 8.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:41:01 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:41:02.806157"], ["id", 3]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:62762/categories Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:41:02.870790"], ["updated_at", "2015-10-27 12:41:02.870790"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.1ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:41:02.889698"], ["updated_at", "2015-10-27 12:41:02.889698"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:41:02.909741"], ["updated_at", "2015-10-27 12:41:02.909741"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:41:02.913165"], ["updated_at", "2015-10-27 12:41:02.913165"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:41:02.916580"], ["updated_at", "2015-10-27 12:41:02.916580"]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (4.7ms) Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:41:02.939968"], ["id", 3]]  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:41:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:43.270282"], ["updated_at", "2015-10-27 12:43:43.270282"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:43.276898"], ["updated_at", "2015-10-27 12:43:43.276898"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:43.279228"], ["updated_at", "2015-10-27 12:43:43.279228"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:43:45 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (172.3ms) Rendered items/new.html.erb within layouts/application (178.6ms) Completed 200 OK in 393ms (Views: 385.5ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:45 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:45 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:43:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 4ms (Views: 0.7ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:43:46.635922"], ["updated_at", "2015-10-27 12:43:46.635922"]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:62788/items Completed 302 Found in 6ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:46.714831"], ["updated_at", "2015-10-27 12:43:46.714831"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:46.718075"], ["updated_at", "2015-10-27 12:43:46.718075"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:46.721040"], ["updated_at", "2015-10-27 12:43:46.721040"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:43:46.724982"], ["updated_at", "2015-10-27 12:43:46.724982"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.3ms) Rendered items/edit.html.erb within layouts/application (5.9ms) Completed 200 OK in 14ms (Views: 8.5ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:46 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:43:47.833786"], ["id", 1]]  (6.3ms) commit transaction Redirected to http://127.0.0.1:62788/items Completed 302 Found in 11ms (ActiveRecord: 6.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (1.2ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:47.905137"], ["updated_at", "2015-10-27 12:43:47.905137"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:47.909568"], ["updated_at", "2015-10-27 12:43:47.909568"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:47.913103"], ["updated_at", "2015-10-27 12:43:47.913103"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:43:47.922381"], ["updated_at", "2015-10-27 12:43:47.922381"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.8ms) Rendered items/edit.html.erb within layouts/application (8.0ms) Completed 200 OK in 11ms (Views: 10.4ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:43:47.955665"], ["id", 1]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:47.975821"], ["updated_at", "2015-10-27 12:43:47.975821"]]  (0.7ms) commit transaction  (0.5ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:47.979498"], ["updated_at", "2015-10-27 12:43:47.979498"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:47.982865"], ["updated_at", "2015-10-27 12:43:47.982865"]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:43:47 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (8.3ms) Rendered items/new.html.erb within layouts/application (8.5ms) Completed 200 OK in 11ms (Views: 10.6ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:43:48 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:43:48.013232"], ["updated_at", "2015-10-27 12:43:48.013232"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:43:48 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:48.038919"], ["updated_at", "2015-10-27 12:43:48.038919"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:48.041910"], ["updated_at", "2015-10-27 12:43:48.041910"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:48.045032"], ["updated_at", "2015-10-27 12:43:48.045032"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:43:48.096532"], ["updated_at", "2015-10-27 12:43:48.096532"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:43:48.099399"], ["updated_at", "2015-10-27 12:43:48.099399"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:43:48.101470"], ["updated_at", "2015-10-27 12:43:48.101470"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:43:48 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (25.1ms) Rendered products/edit.html.erb within layouts/application (27.4ms) Completed 200 OK in 34ms (Views: 31.0ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:48 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:48 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:43:48 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:43:49 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:43:50.267286"], ["updated_at", "2015-10-27 12:43:50.267286"]]  (3.5ms) commit transaction Redirected to http://127.0.0.1:62788/products Completed 302 Found in 11ms (ActiveRecord: 4.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.2ms) Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:50.335759"], ["updated_at", "2015-10-27 12:43:50.335759"]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:50.339108"], ["updated_at", "2015-10-27 12:43:50.339108"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:50.341787"], ["updated_at", "2015-10-27 12:43:50.341787"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.7ms) Rendered products/new.html.erb within layouts/application (4.3ms) Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:43:50 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:43:51 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:43:52.467512"], ["updated_at", "2015-10-27 12:43:52.467512"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:43:52.469085"], ["updated_at", "2015-10-27 12:43:52.469085"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:43:52.470302"], ["updated_at", "2015-10-27 12:43:52.470302"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:62788/products Completed 302 Found in 12ms (ActiveRecord: 3.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 Category Load (0.9ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:52.552043"], ["updated_at", "2015-10-27 12:43:52.552043"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:52.555740"], ["updated_at", "2015-10-27 12:43:52.555740"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:52.559823"], ["updated_at", "2015-10-27 12:43:52.559823"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:43:52.568808"], ["updated_at", "2015-10-27 12:43:52.568808"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:43:52.570519"], ["updated_at", "2015-10-27 12:43:52.570519"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:43:52.572265"], ["updated_at", "2015-10-27 12:43:52.572265"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (9.0ms) Rendered products/edit.html.erb within layouts/application (9.5ms) Completed 200 OK in 12ms (Views: 11.0ms | ActiveRecord: 0.6ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:43:52.605456"], ["updated_at", "2015-10-27 12:43:52.605456"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:43:52.631901"], ["updated_at", "2015-10-27 12:43:52.631901"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:43:52.642486"], ["updated_at", "2015-10-27 12:43:52.642486"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:43:52.645891"], ["updated_at", "2015-10-27 12:43:52.645891"]]  (1.1ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (5.0ms) Rendered products/new.html.erb within layouts/application (5.2ms) Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:43:52.673259"], ["updated_at", "2015-10-27 12:43:52.673259"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:43:52.675078"], ["updated_at", "2015-10-27 12:43:52.675078"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:43:52.677164"], ["updated_at", "2015-10-27 12:43:52.677164"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 14ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:43:52.705846"], ["updated_at", "2015-10-27 12:43:52.705846"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 12:43:52.711305"], ["updated_at", "2015-10-27 12:43:52.711305"]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 12:43:52.715048"], ["updated_at", "2015-10-27 12:43:52.715048"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (7.0ms) Rendered categories/edit.html.erb within layouts/application (9.1ms) Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.6ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:43:52.750453"], ["id", 3]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:43:52.771953"], ["updated_at", "2015-10-27 12:43:52.771953"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.6ms) Rendered categories/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.2ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:43:52.791686"], ["updated_at", "2015-10-27 12:43:52.791686"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:43:52.810655"], ["updated_at", "2015-10-27 12:43:52.810655"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:43:52.813517"], ["updated_at", "2015-10-27 12:43:52.813517"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:43:52.823381"], ["updated_at", "2015-10-27 12:43:52.823381"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.4ms) Rendered categories/edit.html.erb within layouts/application (3.6ms) Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:52 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:43:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:43:53 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:43:53.930659"], ["id", 3]]  (2.2ms) commit transaction Redirected to http://127.0.0.1:62788/categories Completed 302 Found in 6ms (ActiveRecord: 2.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:43:53 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:53 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:53 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.4ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:43:53.990374"], ["updated_at", "2015-10-27 12:43:53.990374"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:43:53 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.2ms) Rendered categories/new.html.erb within layouts/application (2.4ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:54 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:54 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:43:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:43:55 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:43:55.090754"], ["updated_at", "2015-10-27 12:43:55.090754"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:62788/categories Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:43:55 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:43:55 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:43:55 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:00.443472"], ["updated_at", "2015-10-27 12:44:00.443472"]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:00.451072"], ["updated_at", "2015-10-27 12:44:00.451072"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:00.453846"], ["updated_at", "2015-10-27 12:44:00.453846"]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:44:00.493296"], ["updated_at", "2015-10-27 12:44:00.493296"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:44:00.494926"], ["updated_at", "2015-10-27 12:44:00.494926"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:44:00.496194"], ["updated_at", "2015-10-27 12:44:00.496194"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:44:01 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (138.3ms) Rendered products/edit.html.erb within layouts/application (144.0ms) Completed 200 OK in 321ms (Views: 316.4ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:02 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:02 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:44:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:44:03 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:44:04.352163"], ["updated_at", "2015-10-27 12:44:04.352163"]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:62802/products Completed 302 Found in 11ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:04.422058"], ["updated_at", "2015-10-27 12:44:04.422058"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:04.424914"], ["updated_at", "2015-10-27 12:44:04.424914"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:04.427739"], ["updated_at", "2015-10-27 12:44:04.427739"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.0ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:44:04 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 13:44:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:44:06.566135"], ["updated_at", "2015-10-27 12:44:06.566135"]] SQL (0.8ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:44:06.568544"], ["updated_at", "2015-10-27 12:44:06.568544"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:44:06.570891"], ["updated_at", "2015-10-27 12:44:06.570891"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:62802/products Completed 302 Found in 18ms (ActiveRecord: 4.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 12ms (Views: 11.7ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (2.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:06.658898"], ["updated_at", "2015-10-27 12:44:06.658898"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:06.662657"], ["updated_at", "2015-10-27 12:44:06.662657"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:06.665663"], ["updated_at", "2015-10-27 12:44:06.665663"]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 12:44:06.673253"], ["updated_at", "2015-10-27 12:44:06.673253"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:44:06.675331"], ["updated_at", "2015-10-27 12:44:06.675331"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:44:06.677060"], ["updated_at", "2015-10-27 12:44:06.677060"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (12.2ms) Rendered products/edit.html.erb within layouts/application (12.4ms) Completed 200 OK in 16ms (Views: 14.1ms | ActiveRecord: 1.0ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 12:44:06.716221"], ["updated_at", "2015-10-27 12:44:06.716221"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:06.739900"], ["updated_at", "2015-10-27 12:44:06.739900"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:06.743368"], ["updated_at", "2015-10-27 12:44:06.743368"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:06.747922"], ["updated_at", "2015-10-27 12:44:06.747922"]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (6.0ms) Rendered products/new.html.erb within layouts/application (8.1ms) Completed 200 OK in 10ms (Views: 9.7ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 12:44:06.780206"], ["updated_at", "2015-10-27 12:44:06.780206"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 12:44:06.782511"], ["updated_at", "2015-10-27 12:44:06.782511"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 12:44:06.784329"], ["updated_at", "2015-10-27 12:44:06.784329"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 14ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ProductsController#index as HTML Product Load (0.9ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.5ms) Completed 200 OK in 6ms (Views: 4.2ms | ActiveRecord: 1.0ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:06.810801"], ["updated_at", "2015-10-27 12:44:06.810801"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:06.813922"], ["updated_at", "2015-10-27 12:44:06.813922"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:06.816757"], ["updated_at", "2015-10-27 12:44:06.816757"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (36.8ms) Rendered items/new.html.erb within layouts/application (39.1ms) Completed 200 OK in 55ms (Views: 43.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:06 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 13:44:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:44:07 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:44:07.986019"], ["updated_at", "2015-10-27 12:44:07.986019"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62802/items Completed 302 Found in 6ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:44:07 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:08 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:08 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:08.054920"], ["updated_at", "2015-10-27 12:44:08.054920"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:08.058207"], ["updated_at", "2015-10-27 12:44:08.058207"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:08.060899"], ["updated_at", "2015-10-27 12:44:08.060899"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:44:08.064013"], ["updated_at", "2015-10-27 12:44:08.064013"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:44:08 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.7ms) Rendered items/edit.html.erb within layouts/application (7.4ms) Completed 200 OK in 12ms (Views: 10.7ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:08 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:08 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 13:44:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:44:09.187438"], ["id", 1]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62802/items Completed 302 Found in 8ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:09.254551"], ["updated_at", "2015-10-27 12:44:09.254551"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:09.258089"], ["updated_at", "2015-10-27 12:44:09.258089"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:09.260698"], ["updated_at", "2015-10-27 12:44:09.260698"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.3ms) Rendered items/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 12:44:09.279483"], ["updated_at", "2015-10-27 12:44:09.279483"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 12:44:09.298779"], ["updated_at", "2015-10-27 12:44:09.298779"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 12:44:09.301788"], ["updated_at", "2015-10-27 12:44:09.301788"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 12:44:09.304495"], ["updated_at", "2015-10-27 12:44:09.304495"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 12:44:09.307657"], ["updated_at", "2015-10-27 12:44:09.307657"]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.2ms) Rendered items/edit.html.erb within layouts/application (5.3ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 12:44:09.328363"], ["id", 1]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:44:09.349786"], ["updated_at", "2015-10-27 12:44:09.349786"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Rendered categories/new.html.erb within layouts/application (5.8ms) Completed 200 OK in 10ms (Views: 9.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 13:44:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:44:10.461782"], ["updated_at", "2015-10-27 12:44:10.461782"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:62802/categories Completed 302 Found in 8ms (ActiveRecord: 3.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Processing by CategoriesController#index as HTML Category Load (0.9ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.5ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.9ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Category Load (1.0ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.7ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:44:10.571008"], ["updated_at", "2015-10-27 12:44:10.571008"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 12:44:10.574742"], ["updated_at", "2015-10-27 12:44:10.574742"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 12:44:10.579581"], ["updated_at", "2015-10-27 12:44:10.579581"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (6.7ms) Rendered categories/edit.html.erb within layouts/application (8.0ms) Completed 200 OK in 14ms (Views: 11.8ms | ActiveRecord: 0.6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:10 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.8ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:44:11.729304"], ["id", 3]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:62802/categories Completed 302 Found in 7ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.5ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:44:11.805892"], ["updated_at", "2015-10-27 12:44:11.805892"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.8ms) Rendered categories/new.html.erb within layouts/application (5.1ms) Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.3ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 12:44:11.833310"], ["updated_at", "2015-10-27 12:44:11.833310"]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 12:44:11.863274"], ["updated_at", "2015-10-27 12:44:11.863274"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 12:44:11.866572"], ["updated_at", "2015-10-27 12:44:11.866572"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 12:44:11.870490"], ["updated_at", "2015-10-27 12:44:11.870490"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.6ms) Rendered categories/edit.html.erb within layouts/application (4.9ms) Completed 200 OK in 10ms (Views: 8.7ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 12:44:11.894381"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 13:44:11 +0100 Processing by CategoriesController#index as HTML Category Load (0.4ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.4ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.7ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (3.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.6ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.3ms) DELETE FROM sqlite_sequence where name = 'products';  (1.3ms) DELETE FROM "product_has_categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.6ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (1.4ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.7ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (10.5ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (3.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:35.229607"], ["updated_at", "2015-10-27 13:59:35.229607"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:35.236009"], ["updated_at", "2015-10-27 13:59:35.236009"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:35.238351"], ["updated_at", "2015-10-27 13:59:35.238351"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 13:59:35.284712"], ["updated_at", "2015-10-27 13:59:35.284712"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 13:59:35.287156"], ["updated_at", "2015-10-27 13:59:35.287156"]] SQL (0.0ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 13:59:35.288658"], ["updated_at", "2015-10-27 13:59:35.288658"]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 14:59:35 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (155.2ms) Rendered products/edit.html.erb within layouts/application (161.3ms) Completed 200 OK in 342ms (Views: 337.4ms | ActiveRecord: 0.9ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 14:59:35 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 13:59:35.676660"], ["updated_at", "2015-10-27 13:59:35.676660"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 14:59:35 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.3ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:35.704157"], ["updated_at", "2015-10-27 13:59:35.704157"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (1.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:35.708022"], ["updated_at", "2015-10-27 13:59:35.708022"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:35.712426"], ["updated_at", "2015-10-27 13:59:35.712426"]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 14:59:35 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.6ms) Rendered products/new.html.erb within layouts/application (4.2ms) Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 14:59:35 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 13:59:35.737360"], ["updated_at", "2015-10-27 13:59:35.737360"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 13:59:35.738899"], ["updated_at", "2015-10-27 13:59:35.738899"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 13:59:35.740176"], ["updated_at", "2015-10-27 13:59:35.740176"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 14:59:35 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (1.6ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (5.1ms) Completed 200 OK in 7ms (Views: 4.9ms | ActiveRecord: 1.8ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:35.767250"], ["updated_at", "2015-10-27 13:59:35.767250"]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:35.770034"], ["updated_at", "2015-10-27 13:59:35.770034"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:35.772565"], ["updated_at", "2015-10-27 13:59:35.772565"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 13:59:35.777909"], ["updated_at", "2015-10-27 13:59:35.777909"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 13:59:35.779676"], ["updated_at", "2015-10-27 13:59:35.779676"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 13:59:35.781168"], ["updated_at", "2015-10-27 13:59:35.781168"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 14:59:37 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (14.0ms) Rendered products/edit.html.erb within layouts/application (14.8ms) Completed 200 OK in 19ms (Views: 16.6ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:37 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:37 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 14:59:37 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 14:59:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 13:59:39.381818"], ["updated_at", "2015-10-27 13:59:39.381818"]]  (3.9ms) commit transaction Redirected to http://127.0.0.1:63735/products Completed 302 Found in 17ms (ActiveRecord: 5.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.3ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:39.455936"], ["updated_at", "2015-10-27 13:59:39.455936"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:39.459260"], ["updated_at", "2015-10-27 13:59:39.459260"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:39.462665"], ["updated_at", "2015-10-27 13:59:39.462665"]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (6.9ms) Rendered products/new.html.erb within layouts/application (7.1ms) Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 14:59:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 14:59:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 13:59:41.600289"], ["updated_at", "2015-10-27 13:59:41.600289"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 13:59:41.601711"], ["updated_at", "2015-10-27 13:59:41.601711"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 13:59:41.602854"], ["updated_at", "2015-10-27 13:59:41.602854"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:63735/products Completed 302 Found in 20ms (ActiveRecord: 3.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:41.670441"], ["updated_at", "2015-10-27 13:59:41.670441"]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:41.673202"], ["updated_at", "2015-10-27 13:59:41.673202"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:41.675966"], ["updated_at", "2015-10-27 13:59:41.675966"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 13:59:41.685859"], ["updated_at", "2015-10-27 13:59:41.685859"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (29.5ms) Rendered items/edit.html.erb within layouts/application (32.5ms) Completed 200 OK in 39ms (Views: 36.5ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:41 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 13:59:42.825703"], ["id", 1]]  (3.4ms) commit transaction Redirected to http://127.0.0.1:63735/items Completed 302 Found in 8ms (ActiveRecord: 4.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:42.891353"], ["updated_at", "2015-10-27 13:59:42.891353"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:42.896572"], ["updated_at", "2015-10-27 13:59:42.896572"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:42.900823"], ["updated_at", "2015-10-27 13:59:42.900823"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (9.2ms) Rendered items/new.html.erb within layouts/application (9.8ms) Completed 200 OK in 15ms (Views: 14.3ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:42 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 14:59:43 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 13:59:44.029566"], ["updated_at", "2015-10-27 13:59:44.029566"]]  (20.5ms) commit transaction Redirected to http://127.0.0.1:63735/items Completed 302 Found in 25ms (ActiveRecord: 21.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:44.123042"], ["updated_at", "2015-10-27 13:59:44.123042"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:44.128164"], ["updated_at", "2015-10-27 13:59:44.128164"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:44.133671"], ["updated_at", "2015-10-27 13:59:44.133671"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (8.1ms) Rendered items/new.html.erb within layouts/application (8.3ms) Completed 200 OK in 11ms (Views: 10.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 13:59:44.166716"], ["updated_at", "2015-10-27 13:59:44.166716"]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 13:59:44.189871"], ["updated_at", "2015-10-27 13:59:44.189871"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 13:59:44.193170"], ["updated_at", "2015-10-27 13:59:44.193170"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 13:59:44.197085"], ["updated_at", "2015-10-27 13:59:44.197085"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 13:59:44.200927"], ["updated_at", "2015-10-27 13:59:44.200927"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.8ms) Rendered items/edit.html.erb within layouts/application (8.0ms) Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 13:59:44.227215"], ["id", 1]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.8ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 13:59:44.249004"], ["updated_at", "2015-10-27 13:59:44.249004"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (5.5ms) Rendered categories/new.html.erb within layouts/application (9.3ms) Completed 200 OK in 15ms (Views: 14.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 13:59:44.281623"], ["updated_at", "2015-10-27 13:59:44.281623"]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 13:59:44.307663"], ["updated_at", "2015-10-27 13:59:44.307663"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 13:59:44.310910"], ["updated_at", "2015-10-27 13:59:44.310910"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 13:59:44.313631"], ["updated_at", "2015-10-27 13:59:44.313631"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (12.1ms) Rendered categories/edit.html.erb within layouts/application (13.2ms) Completed 200 OK in 17ms (Views: 15.8ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 13:59:44.345050"], ["id", 3]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 13:59:44.361994"], ["updated_at", "2015-10-27 13:59:44.361994"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Rendered categories/new.html.erb within layouts/application (2.9ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 14:59:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 13:59:45.460592"], ["updated_at", "2015-10-27 13:59:45.460592"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:63735/categories Completed 302 Found in 6ms (ActiveRecord: 3.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 13:59:45.524751"], ["updated_at", "2015-10-27 13:59:45.524751"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 13:59:45.527580"], ["updated_at", "2015-10-27 13:59:45.527580"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 13:59:45.530132"], ["updated_at", "2015-10-27 13:59:45.530132"]]  (0.5ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.6ms) Rendered categories/edit.html.erb within layouts/application (3.8ms) Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 14:59:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 14:59:46 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 13:59:46.633479"], ["id", 3]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:63735/categories Completed 302 Found in 5ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 14:59:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 14:59:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 14:59:46 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 13:59:58 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:00:00 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (156.7ms) Rendered products/edit.html.erb within layouts/application (161.8ms) Completed 200 OK in 177.5ms (Views: 173.5ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:00:00 +0100 Compiled token-input-facebook.css (0ms) (pid 68922) Compiled application.css (7ms) (pid 68922) Served asset /application.css - 200 OK (20ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:00:00 +0100 Compiled jquery.js (5ms) (pid 68922) Compiled jquery_ujs.js (0ms) (pid 68922) Compiled jquery.tokeninput.js (0ms) (pid 68922) Compiled application.js (27ms) (pid 68922) Served asset /application.js - 200 OK (39ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:00:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2.3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:00:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 0.9ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:00:02 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 1.2ms  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:02 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:02 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:02 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:00:02 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.4ms) Rendered products/new.html.erb within layouts/application (4.0ms) Completed 200 OK in 6.6ms (Views: 6.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:00:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:00:03 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Completed 500 Internal Server Error in 0.7ms  (2.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.1ms) Rendered products/new.html.erb within layouts/application (4.3ms) Completed 200 OK in 13.6ms (Views: 13.3ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Completed 500 Internal Server Error in 0.7ms  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.6ms) Rendered products/edit.html.erb within layouts/application (6.9ms) Completed 200 OK in 9.3ms (Views: 8.0ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 1.4ms  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (40.7ms) Rendered items/edit.html.erb within layouts/application (42.2ms) Completed 500 Internal Server Error in 48.7ms  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:04 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:00:04 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (19.3ms) Rendered items/new.html.erb within layouts/application (20.1ms) Completed 500 Internal Server Error in 22.6ms  (0.8ms) DELETE FROM "categories";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:00:05 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (17.2ms) Rendered items/new.html.erb within layouts/application (17.5ms) Completed 500 Internal Server Error in 18.5ms  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.5ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:00:05 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (14.3ms) Rendered items/edit.html.erb within layouts/application (14.7ms) Completed 500 Internal Server Error in 16.0ms  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:00:05 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:00:05 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (7.0ms) Rendered categories/edit.html.erb within layouts/application (8.2ms) Completed 200 OK in 14.4ms (Views: 12.8ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:00:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.6ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:00:06 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Completed 500 Internal Server Error in 1.5ms  (3.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:06 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:00:06 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.4ms) Rendered categories/new.html.erb within layouts/application (4.0ms) Completed 200 OK in 16.2ms (Views: 15.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:00:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:00:07 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 0.6ms  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:00:07 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (5.1ms) Rendered categories/edit.html.erb within layouts/application (5.3ms) Completed 200 OK in 7.9ms (Views: 6.6ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:00:07 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Completed 500 Internal Server Error in 1.0ms  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:00:07 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:00:07 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.5ms) Rendered categories/new.html.erb within layouts/application (4.7ms) Completed 200 OK in 6.5ms (Views: 6.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:00:07 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"} Completed 500 Internal Server Error in 0.4ms  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (2.4ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:05:02 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (35.1ms) Rendered items/edit.html.erb within layouts/application (39.1ms) Completed 500 Internal Server Error in 48.8ms  (2.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:05:02 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (22.2ms) Rendered items/new.html.erb within layouts/application (23.1ms) Completed 500 Internal Server Error in 25.5ms  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (14.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.5ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:05:02 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (14.0ms) Rendered items/edit.html.erb within layouts/application (14.2ms) Completed 500 Internal Server Error in 16.5ms  (3.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (13.4ms) Rendered items/new.html.erb within layouts/application (13.7ms) Completed 500 Internal Server Error in 14.3ms  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (87.2ms) Rendered categories/new.html.erb within layouts/application (88.4ms) Completed 200 OK in 94.1ms (Views: 93.6ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 12.5ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 6.7ms (Views: 5.4ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.2ms) Rendered categories/edit.html.erb within layouts/application (4.8ms) Completed 200 OK in 7.8ms (Views: 6.5ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:05:04.805236' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4.8ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3.4ms (Views: 2.5ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:04 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Rendered categories/edit.html.erb within layouts/application (4.4ms) Completed 200 OK in 6.8ms (Views: 5.3ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Served asset /application.css - 200 OK (9ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:05:04 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:05:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:05:05 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:05:05.969355' WHERE "categories"."id" = 3  (2.4ms) commit transaction Redirected to http://127.0.0.1:63914/categories Completed 302 Found in 5.5ms (ActiveRecord: 2.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:05:05 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3.6ms (Views: 2.7ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:06 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:06 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:05:06 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.1ms) Completed 200 OK in 4.5ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:05:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.0ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:05:07 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:63914/categories Completed 302 Found in 5.3ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:05:07 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.1ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:07 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:05:07 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (16.0ms) Rendered products/new.html.erb within layouts/application (18.2ms) Completed 200 OK in 26.8ms (Views: 23.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:05:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:05:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:05:09 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:63914/products Completed 302 Found in 20.3ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:05:09 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (10.1ms) Completed 200 OK in 14.0ms (Views: 12.3ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:09 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:05:09 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.7ms) Rendered products/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 10.6ms (Views: 9.0ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:05:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:05:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:05:11 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 1.5ms  (2.7ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:05:11 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.2ms) Rendered products/new.html.erb within layouts/application (3.4ms) Completed 200 OK in 5.1ms (Views: 4.8ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:05:11 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.3ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:05:11 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 3.4ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:05:11 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:05:11 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.2ms) Rendered products/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 8.7ms (Views: 7.4ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:05:11 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 1.2ms  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:00 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:00 UTC +00:00]]  (2.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:06:01 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (111.8ms) Rendered categories/new.html.erb within layouts/application (115.8ms) Completed 200 OK in 126.7ms (Views: 125.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:06:01 +0100 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:06:01 +0100 Served asset /application.js - 200 OK (5ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:06:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 3.0ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:06:02 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:02 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:02 UTC +00:00]]  (25.8ms) commit transaction Redirected to http://127.0.0.1:63935/categories Completed 302 Found in 32.3ms (ActiveRecord: 26.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:06:03 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 6.0ms (Views: 4.6ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:03 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:03 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:03 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:03 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:03 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:06:03 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (5.8ms) Rendered categories/edit.html.erb within layouts/application (6.6ms) Completed 200 OK in 10.6ms (Views: 9.0ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:06:03 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.7ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:06:04.212778' WHERE "categories"."id" = 3  (2.9ms) commit transaction Redirected to http://127.0.0.1:63935/categories Completed 302 Found in 7.4ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3.3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.4ms) Rendered categories/edit.html.erb within layouts/application (4.6ms) Completed 200 OK in 6.7ms (Views: 5.6ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:06:04.295648' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 2.9ms (Views: 2.2ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.2ms) Rendered categories/new.html.erb within layouts/application (3.4ms) Completed 200 OK in 4.6ms (Views: 4.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 2.7ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2.6ms (Views: 1.9ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (41.7ms) Rendered items/edit.html.erb within layouts/application (42.9ms) Completed 500 Internal Server Error in 48.1ms  (3.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (13.9ms) Rendered items/new.html.erb within layouts/application (14.6ms) Completed 500 Internal Server Error in 16.5ms  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (14.1ms) Rendered items/edit.html.erb within layouts/application (14.3ms) Completed 500 Internal Server Error in 15.7ms  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (13.3ms) Rendered items/new.html.erb within layouts/application (13.6ms) Completed 500 Internal Server Error in 14.6ms  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (16.1ms) Rendered products/new.html.erb within layouts/application (17.4ms) Completed 200 OK in 26.1ms (Views: 22.0ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (2.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 22.4ms (ActiveRecord: 4.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.7ms) 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 Rendered products/index.html.erb within layouts/application (14.8ms) Completed 200 OK in 19.0ms (Views: 16.8ms | ActiveRecord: 0.8ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (12.9ms) Rendered products/edit.html.erb within layouts/application (13.9ms) Completed 200 OK in 21.0ms (Views: 18.2ms | ActiveRecord: 0.8ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 12.1ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 5.2ms (Views: 4.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.4ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:04 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:06:04 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.6ms) Rendered products/new.html.erb within layouts/application (3.8ms) Completed 200 OK in 5.4ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:06:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:06:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:06:06 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:06 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:06:06 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:06:06 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:06 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:06:06 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:06 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:63935/products Completed 302 Found in 8.6ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:06:06 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 5.0ms (Views: 3.0ms | ActiveRecord: 1.0ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:07 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:06:07 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.6ms) Rendered products/edit.html.erb within layouts/application (6.8ms) Completed 200 OK in 9.0ms (Views: 7.7ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:06:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:06:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:06:09 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:06:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:06:09 UTC +00:00]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:63935/products Completed 302 Found in 9.5ms (ActiveRecord: 4.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:06:09 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4.2ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (5.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:08:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:08:53 UTC +00:00]]  (2.5ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:08:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:08:53 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:08:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:08:53 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:08:55 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7108.2ms) Rendered items/new.html.erb within layouts/application (7112.2ms) Completed 500 Internal Server Error in 7125.1ms  (3.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:09:02 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:09:02 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (715.1ms) Rendered items/edit.html.erb within layouts/application (715.9ms) Completed 500 Internal Server Error in 719.9ms  (2.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:09:03 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (442.7ms) Rendered items/new.html.erb within layouts/application (443.0ms) Completed 500 Internal Server Error in 443.6ms  (3.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:09:03 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:09:03 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (418.0ms) Rendered items/edit.html.erb within layouts/application (418.3ms) Completed 500 Internal Server Error in 420.3ms  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.9ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00]]  (3.1ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:09:07 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:09:09 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (216264.2ms) Rendered items/edit.html.erb within layouts/application (216268.3ms) Completed 500 Internal Server Error in 216281.5ms  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:45 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:45 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:45 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:45 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:45 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:45 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:12:45 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (1101.6ms) Rendered items/new.html.erb within layouts/application (1102.7ms) Completed 500 Internal Server Error in 1105.5ms  (3.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:12:46 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:12:46 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Rendered items/_form.html.erb (475.4ms) Rendered items/edit.html.erb within layouts/application (475.6ms) Completed 500 Internal Server Error in 478.4ms  (2.6ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:47 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:47 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:47 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:47 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:47 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:47 UTC +00:00]]  (0.5ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:12:47 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (442.5ms) Rendered items/new.html.erb within layouts/application (442.8ms) Completed 500 Internal Server Error in 443.6ms  (2.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:12:51 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:12:53 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (104.6ms) Rendered items/edit.html.erb within layouts/application (108.9ms) Completed 200 OK in 121.4ms (Views: 118.8ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:12:53 +0100 Served asset /application.css - 200 OK (6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:12:53 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:12:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:12:54 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:12:54.389086' WHERE "items"."id" = 1  (2.4ms) commit transaction Redirected to http://127.0.0.1:64015/items Completed 302 Found in 9.0ms (ActiveRecord: 2.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:12:54 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5.5ms (Views: 4.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:54 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:54 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:54 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:12:54 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.9ms) Rendered items/new.html.erb within layouts/application (5.5ms) Completed 200 OK in 7.9ms (Views: 7.4ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:12:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64015/items Completed 302 Found in 5.8ms (ActiveRecord: 3.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3.0ms (Views: 1.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (6.2ms) Rendered items/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 8.4ms (Views: 7.4ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:12:55.631694' WHERE "items"."id" = 1  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.4ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#index as HTML Item Load (0.4ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3.3ms (Views: 2.0ms | ActiveRecord: 0.4ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.2ms) Rendered items/new.html.erb within layouts/application (7.4ms) Completed 200 OK in 9.1ms (Views: 8.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:12:55 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.9ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:12:55 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3.1ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (3.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:13:09 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (93.5ms) Rendered categories/new.html.erb within layouts/application (97.3ms) Completed 200 OK in 107.7ms (Views: 107.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:13:09 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (7.3ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 12.9ms (ActiveRecord: 7.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5.7ms (Views: 4.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:13:09 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.7ms) Rendered categories/edit.html.erb within layouts/application (5.3ms) Completed 200 OK in 8.5ms (Views: 7.2ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:13:09 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:13:09.794531' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4.6ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:09 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.4ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:09 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:13:11 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.7ms) Rendered categories/edit.html.erb within layouts/application (5.1ms) Completed 200 OK in 8.1ms (Views: 6.3ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:11 +0100 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:11 +0100 Served asset /application.js - 200 OK (6ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:13:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.9ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:13:12 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:13:12.436149' WHERE "categories"."id" = 3  (2.8ms) commit transaction Redirected to http://127.0.0.1:64028/categories Completed 302 Found in 5.9ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:12 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4.6ms (Views: 3.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:12 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:12 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:13:12 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.1ms) Completed 200 OK in 4.5ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:13:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:13:13 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:64028/categories Completed 302 Found in 5.1ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.2ms (Views: 2.5ms | ActiveRecord: 0.1ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:13 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:13:13 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (20.2ms) Rendered items/new.html.erb within layouts/application (21.4ms) Completed 200 OK in 30.5ms (Views: 25.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:13:14 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:64028/items Completed 302 Found in 9.0ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:14 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 5.5ms (Views: 3.8ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:13:14 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:13:14 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (6.5ms) Rendered items/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 11.5ms (Views: 9.6ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:13:15 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:13:15 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:13:15.941638' WHERE "items"."id" = 1  (3.2ms) commit transaction Redirected to http://127.0.0.1:64028/items Completed 302 Found in 10.6ms (ActiveRecord: 3.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:15 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 3.3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.5ms) commit transaction  (0.2ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.5ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.9ms) Rendered items/new.html.erb within layouts/application (5.2ms) Completed 200 OK in 6.5ms (Views: 6.3ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.0ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 2.6ms (Views: 1.9ms | ActiveRecord: 0.1ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.8ms) Rendered items/edit.html.erb within layouts/application (6.0ms) Completed 200 OK in 8.0ms (Views: 7.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:13:16.070399' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.6ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2.8ms (Views: 2.2ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (1.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]] SQL (0.5ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:16 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (24.6ms) Rendered products/edit.html.erb within layouts/application (25.8ms) Completed 200 OK in 34.0ms (Views: 31.1ms | ActiveRecord: 0.9ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:13:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.4ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 0.9ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:13:18 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.7ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.6ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64028/products Completed 302 Found in 18.0ms (ActiveRecord: 5.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:18 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (0.3ms) 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 Rendered products/index.html.erb within layouts/application (2.7ms) Completed 200 OK in 5.7ms (Views: 4.4ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:18 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:13:18 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.4ms) Rendered products/new.html.erb within layouts/application (5.0ms) Completed 200 OK in 7.7ms (Views: 7.3ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.4ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:13:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 0.9ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:64028/products Completed 302 Found in 6.9ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3.7ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.4ms) Rendered products/new.html.erb within layouts/application (3.6ms) Completed 200 OK in 5.1ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.3ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 3.4ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.2ms) Rendered products/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 8.6ms (Views: 7.4ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:20 UTC +00:00]]  (0.6ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.2ms (ActiveRecord: 1.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:20 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3.3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (3.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:13:36 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (102.1ms) Rendered items/new.html.erb within layouts/application (106.0ms) Completed 200 OK in 119.8ms (Views: 115.7ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:13:36 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 7.8ms (ActiveRecord: 3.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4.5ms (Views: 3.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:13:36 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.7ms) Rendered items/edit.html.erb within layouts/application (6.3ms) Completed 200 OK in 9.2ms (Views: 7.9ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:13:36 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:13:36.501462' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4.4ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2.6ms (Views: 1.8ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:13:36 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:13:37 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (7.4ms) Rendered items/edit.html.erb within layouts/application (7.6ms) Completed 200 OK in 10.5ms (Views: 8.6ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:37 +0100 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:37 +0100 Served asset /application.js - 200 OK (15ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:13:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2.3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:13:39 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:13:39.073269' WHERE "items"."id" = 1  (3.4ms) commit transaction Redirected to http://127.0.0.1:64042/items Completed 302 Found in 6.4ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:39 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3.2ms (Views: 2.4ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.3ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:39 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:39 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:39 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:39 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:39 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:39 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:13:39 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.6ms) Rendered items/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 6.2ms (Views: 6.0ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:13:40 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:40 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:40 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:64042/items Completed 302 Found in 5.6ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:40 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3.1ms (Views: 2.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:40 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:40 UTC +00:00]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:13:40 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.8ms) Rendered categories/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 11.1ms (Views: 10.6ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:13:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.0ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:13:41 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:64042/categories Completed 302 Found in 7.2ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:41 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 5.5ms (Views: 4.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:41 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:13:41 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.4ms) Rendered categories/edit.html.erb within layouts/application (5.0ms) Completed 200 OK in 7.9ms (Views: 6.6ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:13:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:13:42.511704' WHERE "categories"."id" = 3  (3.5ms) commit transaction Redirected to http://127.0.0.1:64042/categories Completed 302 Found in 6.7ms (ActiveRecord: 3.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4.2ms (Views: 3.1ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.0ms) Rendered categories/new.html.erb within layouts/application (3.2ms) Completed 200 OK in 4.5ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.3ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2.7ms (Views: 2.1ms | ActiveRecord: 0.1ms) Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (4.7ms) Completed 200 OK in 6.6ms (Views: 5.7ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:13:42.625324' WHERE "categories"."id" = 3  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.5ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.0ms (Views: 2.3ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (13.7ms) Rendered products/new.html.erb within layouts/application (15.2ms) Completed 200 OK in 23.4ms (Views: 19.6ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 18.1ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (9.8ms) Completed 200 OK in 13.0ms (Views: 11.7ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (7.1ms) Rendered products/edit.html.erb within layouts/application (7.6ms) Completed 200 OK in 10.9ms (Views: 9.4ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9.1ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4.6ms (Views: 3.5ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:42 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:13:42 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (7.0ms) Rendered products/edit.html.erb within layouts/application (7.2ms) Completed 200 OK in 10.0ms (Views: 8.2ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:13:43 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:13:44 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:64042/products Completed 302 Found in 9.1ms (ActiveRecord: 4.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:44 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4.2ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:13:44 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:13:44 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.4ms) Rendered products/new.html.erb within layouts/application (3.6ms) Completed 200 OK in 5.1ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:13:46 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 0.9ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:13:47 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:13:47 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:13:47 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:13:47 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:47 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:13:47 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:13:47 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:64042/products Completed 302 Found in 10.3ms (ActiveRecord: 4.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:47 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4.1ms (Views: 3.3ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:52.336236"], ["updated_at", "2015-10-27 14:13:52.336236"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:52.342681"], ["updated_at", "2015-10-27 14:13:52.342681"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:52.345316"], ["updated_at", "2015-10-27 14:13:52.345316"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:13:52.390235"], ["updated_at", "2015-10-27 14:13:52.390235"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:13:52.392255"], ["updated_at", "2015-10-27 14:13:52.392255"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:13:52.393550"], ["updated_at", "2015-10-27 14:13:52.393550"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:13:52 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (135.9ms) Rendered products/edit.html.erb within layouts/application (141.3ms) Completed 200 OK in 329ms (Views: 324.3ms | ActiveRecord: 0.8ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:13:52 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:13:52.754726"], ["updated_at", "2015-10-27 14:13:52.754726"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:52 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:52.779744"], ["updated_at", "2015-10-27 14:13:52.779744"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:52.782628"], ["updated_at", "2015-10-27 14:13:52.782628"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:52.785338"], ["updated_at", "2015-10-27 14:13:52.785338"]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:13:52 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.1ms) Rendered products/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:13:52 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:13:52.808506"], ["updated_at", "2015-10-27 14:13:52.808506"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:13:52.810142"], ["updated_at", "2015-10-27 14:13:52.810142"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:13:52.811558"], ["updated_at", "2015-10-27 14:13:52.811558"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:52 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:52.835340"], ["updated_at", "2015-10-27 14:13:52.835340"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:52.838246"], ["updated_at", "2015-10-27 14:13:52.838246"]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:52.840564"], ["updated_at", "2015-10-27 14:13:52.840564"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:13:52.846117"], ["updated_at", "2015-10-27 14:13:52.846117"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:13:52.847467"], ["updated_at", "2015-10-27 14:13:52.847467"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:13:52.848837"], ["updated_at", "2015-10-27 14:13:52.848837"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:13:54 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (12.1ms) Rendered products/edit.html.erb within layouts/application (12.3ms) Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 1.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:54 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:54 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:13:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:13:56.410532"], ["updated_at", "2015-10-27 14:13:56.410532"]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64052/products Completed 302 Found in 13ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:56.481980"], ["updated_at", "2015-10-27 14:13:56.481980"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:56.485425"], ["updated_at", "2015-10-27 14:13:56.485425"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:56.488378"], ["updated_at", "2015-10-27 14:13:56.488378"]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (6.0ms) Rendered products/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:13:56 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:13:57 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:13:58.628759"], ["updated_at", "2015-10-27 14:13:58.628759"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:13:58.630630"], ["updated_at", "2015-10-27 14:13:58.630630"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:13:58.632340"], ["updated_at", "2015-10-27 14:13:58.632340"]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64052/products Completed 302 Found in 15ms (ActiveRecord: 3.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:58.709575"], ["updated_at", "2015-10-27 14:13:58.709575"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:58.712262"], ["updated_at", "2015-10-27 14:13:58.712262"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:58.714915"], ["updated_at", "2015-10-27 14:13:58.714915"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:13:58.723370"], ["updated_at", "2015-10-27 14:13:58.723370"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (29.3ms) Rendered items/edit.html.erb within layouts/application (31.0ms) Completed 200 OK in 36ms (Views: 34.7ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:13:58.778377"], ["id", 1]]  (1.0ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:58.799015"], ["updated_at", "2015-10-27 14:13:58.799015"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:58.802083"], ["updated_at", "2015-10-27 14:13:58.802083"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:58.804713"], ["updated_at", "2015-10-27 14:13:58.804713"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.8ms) Rendered items/new.html.erb within layouts/application (5.4ms) Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:13:58.824960"], ["updated_at", "2015-10-27 14:13:58.824960"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:13:58.843816"], ["updated_at", "2015-10-27 14:13:58.843816"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:13:58.846905"], ["updated_at", "2015-10-27 14:13:58.846905"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:13:58.849602"], ["updated_at", "2015-10-27 14:13:58.849602"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:13:58.852370"], ["updated_at", "2015-10-27 14:13:58.852370"]]  (1.1ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.5ms) Rendered items/edit.html.erb within layouts/application (5.7ms) Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:58 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:13:59 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:13:59 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:13:59.962731"], ["id", 1]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64052/items Completed 302 Found in 7ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:13:59 +0100 Processing by ItemsController#index as HTML Item Load (0.4ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:13:59 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:13:59 +0100 Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.4ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:14:00.030559"], ["updated_at", "2015-10-27 14:14:00.030559"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:14:00.033972"], ["updated_at", "2015-10-27 14:14:00.033972"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:14:00.037145"], ["updated_at", "2015-10-27 14:14:00.037145"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:14:00 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.9ms) Rendered items/new.html.erb within layouts/application (7.1ms) Completed 200 OK in 11ms (Views: 9.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:14:00 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:14:00 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:14:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:14:01.149009"], ["updated_at", "2015-10-27 14:14:01.149009"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:64052/items Completed 302 Found in 7ms (ActiveRecord: 3.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:14:01.226349"], ["updated_at", "2015-10-27 14:14:01.226349"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 14:14:01.229557"], ["updated_at", "2015-10-27 14:14:01.229557"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 14:14:01.233203"], ["updated_at", "2015-10-27 14:14:01.233203"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (5.5ms) Rendered categories/edit.html.erb within layouts/application (6.9ms) Completed 200 OK in 12ms (Views: 11.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:14:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:14:02.387488"], ["id", 3]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:64052/categories Completed 302 Found in 7ms (ActiveRecord: 2.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (4.7ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.3ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:14:02.456954"], ["updated_at", "2015-10-27 14:14:02.456954"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.7ms) Rendered categories/new.html.erb within layouts/application (3.4ms) Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:14:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:14:03.554321"], ["updated_at", "2015-10-27 14:14:03.554321"]]  (2.2ms) commit transaction Redirected to http://127.0.0.1:64052/categories Completed 302 Found in 5ms (ActiveRecord: 2.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:14:03.615439"], ["updated_at", "2015-10-27 14:14:03.615439"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Rendered categories/new.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:14:03.632541"], ["updated_at", "2015-10-27 14:14:03.632541"]]  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:14:03.652506"], ["updated_at", "2015-10-27 14:14:03.652506"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 14:14:03.655441"], ["updated_at", "2015-10-27 14:14:03.655441"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 14:14:03.657990"], ["updated_at", "2015-10-27 14:14:03.657990"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (10.3ms) Rendered categories/edit.html.erb within layouts/application (10.5ms) Completed 200 OK in 12ms (Views: 11.6ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:14:03.682248"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:14:03 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (4.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:52 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:52 UTC +00:00]]  (3.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:52 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:52 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:52 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:52 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:15:52 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (140.3ms) Rendered products/new.html.erb within layouts/application (147.0ms) Completed 200 OK in 166.2ms (Views: 161.4ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:15:53 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 32.5ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:15:53 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (9.8ms) Completed 200 OK in 13.4ms (Views: 12.1ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:15:53 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (9.4ms) Rendered products/edit.html.erb within layouts/application (10.0ms) Completed 200 OK in 13.2ms (Views: 11.6ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:15:53 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8.7ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:15:53 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3.6ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:53 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:15:54 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.2ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 6.4ms (Views: 6.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:15:54 +0100 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:15:54 +0100 Served asset /application.js - 200 OK (7ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:15:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2.8ms (Views: 0.3ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:15:56 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:15:57 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64081/products Completed 302 Found in 9.9ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:15:57 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 5.0ms (Views: 3.4ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:57 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:15:57 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (7.0ms) Rendered products/edit.html.erb within layouts/application (7.2ms) Completed 200 OK in 9.5ms (Views: 8.2ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:15:57 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:15:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.7ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:64081/products Completed 302 Found in 7.1ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 4.9ms (Views: 4.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (31.2ms) Rendered items/new.html.erb within layouts/application (33.0ms) Completed 200 OK in 45.3ms (Views: 38.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6.7ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4.8ms (Views: 3.5ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (1.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (8.7ms) Rendered items/edit.html.erb within layouts/application (9.3ms) Completed 200 OK in 13.6ms (Views: 11.8ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.2ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:15:59.515960' WHERE "items"."id" = 1  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4.9ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 2.8ms (Views: 2.2ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (9.6ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:15:59 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (6.3ms) Rendered items/edit.html.erb within layouts/application (6.6ms) Completed 200 OK in 9.0ms (Views: 7.5ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:15:59 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:16:00 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:16:00.660760' WHERE "items"."id" = 1  (1.2ms) commit transaction Redirected to http://127.0.0.1:64081/items Completed 302 Found in 6.5ms (ActiveRecord: 1.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:16:00 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 4.3ms (Views: 3.1ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:00 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:00 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:00 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:00 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:00 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:00 UTC +00:00]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:16:00 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.5ms) Rendered items/new.html.erb within layouts/application (5.9ms) Completed 200 OK in 7.4ms (Views: 7.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:64081/items Completed 302 Found in 5.0ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2.8ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (7.4ms) Rendered categories/edit.html.erb within layouts/application (8.6ms) Completed 200 OK in 14.6ms (Views: 13.3ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:16:01.936437' WHERE "categories"."id" = 3  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7.7ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5.8ms (Views: 4.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.4ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.5ms) Rendered categories/new.html.erb within layouts/application (5.5ms) Completed 200 OK in 8.5ms (Views: 7.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:16:01 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.8ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:01 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4.3ms (Views: 3.1ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:02 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:02 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:02 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:02 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:02 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:16:02 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:16:02 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (6.2ms) Rendered categories/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 8.9ms (Views: 7.4ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:16:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.2ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:16:03 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:16:03.125785' WHERE "categories"."id" = 3  (3.0ms) commit transaction Redirected to http://127.0.0.1:64081/categories Completed 302 Found in 7.0ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:03 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4.0ms (Views: 3.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:03 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:16:03 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:16:03 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.7ms) Rendered categories/new.html.erb within layouts/application (3.9ms) Completed 200 OK in 5.6ms (Views: 5.3ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:16:03 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:16:04 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:16:04 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:16:04 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64081/categories Completed 302 Found in 5.6ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3.2ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:08.078990"], ["updated_at", "2015-10-27 14:16:08.078990"]]  (3.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:08.086669"], ["updated_at", "2015-10-27 14:16:08.086669"]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:08.089104"], ["updated_at", "2015-10-27 14:16:08.089104"]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:16:08.129987"], ["updated_at", "2015-10-27 14:16:08.129987"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:16:08.131565"], ["updated_at", "2015-10-27 14:16:08.131565"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:16:08.132661"], ["updated_at", "2015-10-27 14:16:08.132661"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:16:09 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (120.4ms) Rendered products/edit.html.erb within layouts/application (124.9ms) Completed 200 OK in 328ms (Views: 322.9ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:09 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:16:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:16:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:16:11 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:16:11.973920"], ["updated_at", "2015-10-27 14:16:11.973920"]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64094/products Completed 302 Found in 15ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:16:11 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (5.0ms) Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:12 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:12 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.6ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (2.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:12.064350"], ["updated_at", "2015-10-27 14:16:12.064350"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:12.068080"], ["updated_at", "2015-10-27 14:16:12.068080"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:12.071026"], ["updated_at", "2015-10-27 14:16:12.071026"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:16:12 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.5ms) Rendered products/new.html.erb within layouts/application (5.4ms) Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:12 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:12 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:16:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:16:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:16:14.203334"], ["updated_at", "2015-10-27 14:16:14.203334"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:16:14.205600"], ["updated_at", "2015-10-27 14:16:14.205600"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:16:14.207529"], ["updated_at", "2015-10-27 14:16:14.207529"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:64094/products Completed 302 Found in 16ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:14.280606"], ["updated_at", "2015-10-27 14:16:14.280606"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:14.283706"], ["updated_at", "2015-10-27 14:16:14.283706"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:14.286421"], ["updated_at", "2015-10-27 14:16:14.286421"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:16:14.294916"], ["updated_at", "2015-10-27 14:16:14.294916"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:16:14.296995"], ["updated_at", "2015-10-27 14:16:14.296995"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:16:14.298146"], ["updated_at", "2015-10-27 14:16:14.298146"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (9.7ms) Rendered products/edit.html.erb within layouts/application (10.6ms) Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 0.6ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:16:14.334003"], ["updated_at", "2015-10-27 14:16:14.334003"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.6ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.3ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:14.360568"], ["updated_at", "2015-10-27 14:16:14.360568"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:14.363491"], ["updated_at", "2015-10-27 14:16:14.363491"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:14.365981"], ["updated_at", "2015-10-27 14:16:14.365981"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.5ms) Rendered products/new.html.erb within layouts/application (3.7ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:16:14.392157"], ["updated_at", "2015-10-27 14:16:14.392157"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:16:14.393845"], ["updated_at", "2015-10-27 14:16:14.393845"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:16:14.395464"], ["updated_at", "2015-10-27 14:16:14.395464"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 16ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:16:14.415356"], ["updated_at", "2015-10-27 14:16:14.415356"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 14:16:14.418317"], ["updated_at", "2015-10-27 14:16:14.418317"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 14:16:14.420816"], ["updated_at", "2015-10-27 14:16:14.420816"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.2ms) Rendered categories/edit.html.erb within layouts/application (5.7ms) Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:16:14.444116"], ["id", 3]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:16:14.462469"], ["updated_at", "2015-10-27 14:16:14.462469"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.4ms) Rendered categories/new.html.erb within layouts/application (2.9ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:16:14.479414"], ["updated_at", "2015-10-27 14:16:14.479414"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:16:14.496909"], ["updated_at", "2015-10-27 14:16:14.496909"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 14:16:14.500056"], ["updated_at", "2015-10-27 14:16:14.500056"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 14:16:14.502991"], ["updated_at", "2015-10-27 14:16:14.502991"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.7ms) Rendered categories/edit.html.erb within layouts/application (3.9ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:16:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:16:15.610008"], ["id", 3]]  (2.2ms) commit transaction Redirected to http://127.0.0.1:64094/categories Completed 302 Found in 5ms (ActiveRecord: 2.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.9ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:16:15.674631"], ["updated_at", "2015-10-27 14:16:15.674631"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.2ms) Rendered categories/new.html.erb within layouts/application (4.4ms) Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:15 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:16:16.786747"], ["updated_at", "2015-10-27 14:16:16.786747"]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:64094/categories Completed 302 Found in 6ms (ActiveRecord: 3.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Category Load (1.1ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:16.858723"], ["updated_at", "2015-10-27 14:16:16.858723"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:16.862844"], ["updated_at", "2015-10-27 14:16:16.862844"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:16.866526"], ["updated_at", "2015-10-27 14:16:16.866526"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:16:16.881982"], ["updated_at", "2015-10-27 14:16:16.881982"]]  (0.9ms) commit transaction Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (31.8ms) Rendered items/edit.html.erb within layouts/application (33.4ms) Completed 200 OK in 40ms (Views: 37.6ms | ActiveRecord: 0.4ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:16:16.942634"], ["id", 1]]  (2.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 7ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:16.965485"], ["updated_at", "2015-10-27 14:16:16.965485"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:16.968841"], ["updated_at", "2015-10-27 14:16:16.968841"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:16.972310"], ["updated_at", "2015-10-27 14:16:16.972310"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.6ms) Rendered items/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:16:16 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:16:16.992469"], ["updated_at", "2015-10-27 14:16:16.992469"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 11ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:16:17 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:17.018290"], ["updated_at", "2015-10-27 14:16:17.018290"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:17.021096"], ["updated_at", "2015-10-27 14:16:17.021096"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:17.023437"], ["updated_at", "2015-10-27 14:16:17.023437"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:16:17.025892"], ["updated_at", "2015-10-27 14:16:17.025892"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:16:17 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (4.6ms) Rendered items/edit.html.erb within layouts/application (4.8ms) Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:17 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:16:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:16:18.125084"], ["id", 1]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:64094/items Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:16:18.183281"], ["updated_at", "2015-10-27 14:16:18.183281"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:16:18.186176"], ["updated_at", "2015-10-27 14:16:18.186176"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:16:18.188732"], ["updated_at", "2015-10-27 14:16:18.188732"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (3.6ms) Rendered items/new.html.erb within layouts/application (3.8ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:16:18 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:16:19 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:16:19.287044"], ["updated_at", "2015-10-27 14:16:19.287044"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:64094/items Completed 302 Found in 5ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:16:19 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:16:19 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:16:19 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:03 UTC +00:00]]  (1.2ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:05 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (121.0ms) Rendered products/edit.html.erb within layouts/application (126.2ms) Completed 200 OK in 150.6ms (Views: 146.5ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:05 +0100 Served asset /application.css - 200 OK (9ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:05 +0100 Served asset /application.js - 200 OK (9ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:32:07 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:64736/products Completed 302 Found in 11.8ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:07 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6.4ms (Views: 4.8ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:07 UTC +00:00]]  (0.5ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:07 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.8ms) Rendered products/new.html.erb within layouts/application (5.5ms) Completed 200 OK in 9.2ms (Views: 8.6ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:32:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:09 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:09 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:09 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:09 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:09 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:09 UTC +00:00]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:64736/products Completed 302 Found in 8.8ms (ActiveRecord: 3.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:09 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3.8ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.1ms) Rendered products/new.html.erb within layouts/application (4.3ms) Completed 200 OK in 5.9ms (Views: 5.6ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.6ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 3.7ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.2ms) Rendered products/edit.html.erb within layouts/application (6.3ms) Completed 200 OK in 8.8ms (Views: 7.6ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.4ms (ActiveRecord: 1.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 3.4ms (Views: 2.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:32:10 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (28.4ms) Rendered items/edit.html.erb within layouts/application (30.0ms) Completed 200 OK in 36.9ms (Views: 34.9ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.6ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:32:11 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:32:11.254213' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://127.0.0.1:64736/items Completed 302 Found in 9.7ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:11 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5.7ms (Views: 4.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (2.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:11 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:11 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:11 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:11 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:11 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:11 UTC +00:00]]  (1.1ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:11 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.6ms) Rendered items/new.html.erb within layouts/application (8.4ms) Completed 200 OK in 12.1ms (Views: 11.5ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:64736/items Completed 302 Found in 6.4ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 4.7ms (Views: 3.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (7.7ms) Rendered items/edit.html.erb within layouts/application (7.9ms) Completed 200 OK in 10.5ms (Views: 9.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:32:12.534626' WHERE "items"."id" = 1  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4.0ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3.0ms (Views: 2.3ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.1ms) Rendered items/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 6.9ms (Views: 6.7ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.2ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2.6ms (Views: 2.0ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:12 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (6.2ms) Rendered categories/new.html.erb within layouts/application (8.5ms) Completed 200 OK in 14.5ms (Views: 14.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:32:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:13 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64736/categories Completed 302 Found in 18.4ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5.4ms (Views: 4.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:13 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:13 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (5.1ms) Completed 200 OK in 8.3ms (Views: 7.1ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:32:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:14 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:32:14.867257' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://127.0.0.1:64736/categories Completed 302 Found in 6.3ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4.4ms (Views: 2.8ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:14 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.7ms) Rendered categories/new.html.erb within layouts/application (4.0ms) Completed 200 OK in 5.8ms (Views: 5.6ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:14 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4.2ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:14 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4.9ms (Views: 3.7ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (2.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (3.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (6.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:14 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:15 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (7.9ms) Rendered categories/edit.html.erb within layouts/application (8.3ms) Completed 200 OK in 11.7ms (Views: 10.2ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:15 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:32:15.029671' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7.7ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (4.9ms) Completed 200 OK in 8.0ms (Views: 6.8ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (4.7ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:18 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:32:18 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:18 UTC +00:00], ["name", "new parent"], ["updated_at", Tue, 27 Oct 2015 14:32:18 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:18 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:18 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:20 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (1.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (138.6ms) Rendered categories/edit.html.erb within layouts/application (146.0ms) Completed 200 OK in 493ms (Views: 489.6ms | ActiveRecord: 1.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:20 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:20 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:32:21 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:21 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction SQL (0.6ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", Tue, 27 Oct 2015 14:32:21 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:64751/categories Completed 302 Found in 6ms (ActiveRecord: 1.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:21 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:21 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:21 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:22 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:32:22 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:22 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.0ms) Rendered categories/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:22 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:22 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:32:22 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64751/categories Completed 302 Found in 5ms (ActiveRecord: 3.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.0ms) Rendered categories/new.html.erb within layouts/application (3.2ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "category_2"], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.7ms) Rendered categories/edit.html.erb within layouts/application (3.9ms) Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:23 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (21.5ms) Rendered products/new.html.erb within layouts/application (23.2ms) Completed 200 OK in 31ms (Views: 26.5ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:23 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:32:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:64751/products Completed 302 Found in 17ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Processing by ProductsController#index as HTML Product Load (0.3ms) SELECT "products".* FROM "products"  (0.3ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (20.2ms) Completed 200 OK in 25ms (Views: 24.4ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 Category Load (0.4ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (2.6ms) DELETE FROM "categories";  (2.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (2.2ms) DELETE FROM "product_has_categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (1.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:25 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (7.6ms) Rendered products/edit.html.erb within layouts/application (8.5ms) Completed 200 OK in 13ms (Views: 11.0ms | ActiveRecord: 0.7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:25 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 5ms (Views: 0.5ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.6ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://127.0.0.1:64751/products Completed 302 Found in 14ms (ActiveRecord: 2.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.5ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.5ms) Rendered products/edit.html.erb within layouts/application (6.7ms) Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.4ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.5ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.1ms) Rendered products/new.html.erb within layouts/application (4.4ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (36.4ms) Rendered items/new.html.erb within layouts/application (39.1ms) Completed 200 OK in 51ms (Views: 45.7ms | ActiveRecord: 0.6ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:27 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:27 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (3.2ms) Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.1ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.7ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (10.1ms) Rendered items/edit.html.erb within layouts/application (16.4ms) Completed 200 OK in 21ms (Views: 19.1ms | ActiveRecord: 0.8ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.6ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:28 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.0ms) Rendered items/new.html.erb within layouts/application (7.2ms) Completed 200 OK in 9ms (Views: 9.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.2ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:64751/items Completed 302 Found in 5ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:32:29 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (8.9ms) Rendered items/edit.html.erb within layouts/application (9.4ms) Completed 200 OK in 12ms (Views: 11.0ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:29 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:32:30 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", Tue, 27 Oct 2015 14:32:30 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64751/items Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:30 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:30 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:30 +0100 Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.355139"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:34.355139"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.360777"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:34.360777"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.363014"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:34.363014"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:34 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (126.0ms) Rendered products/new.html.erb within layouts/application (130.9ms) Completed 200 OK in 289ms (Views: 284.4ms | ActiveRecord: 0.4ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:34 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.690273"], ["name", "hello"], ["updated_at", "2015-10-27 14:32:34.690273"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:32:34.691863"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.691863"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:34.692844"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.692844"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 18ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:34 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (8.4ms) Completed 200 OK in 11ms (Views: 10.4ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.6ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.725117"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:34.725117"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.728000"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:34.728000"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.730279"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:34.730279"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.735047"], ["name", "product"], ["updated_at", "2015-10-27 14:32:34.735047"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:34.736231"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.736231"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:32:34.737603"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.737603"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:34 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.3ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (8.0ms) Rendered products/edit.html.erb within layouts/application (8.7ms) Completed 200 OK in 12ms (Views: 11.0ms | ActiveRecord: 0.7ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:32:34 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", "2015-10-27 14:32:34.789954"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.789954"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:34 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.811152"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:34.811152"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.813843"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:34.813843"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.816072"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:34.816072"]]  (0.9ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:34.820854"], ["name", "product"], ["updated_at", "2015-10-27 14:32:34.820854"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:34.822007"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.822007"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:32:34.822985"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:34.822985"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:36 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (7.9ms) Rendered products/edit.html.erb within layouts/application (8.2ms) Completed 200 OK in 12ms (Views: 9.4ms | ActiveRecord: 0.9ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:36 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:36 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:36 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:37 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", "2015-10-27 14:32:38.378527"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:38.378527"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64762/products Completed 302 Found in 13ms (ActiveRecord: 4.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:38.454962"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:38.454962"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:38.457954"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:38.457954"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:38.461076"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:38.461076"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (5.7ms) Rendered products/new.html.erb within layouts/application (5.9ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (1.0ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 1.0ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:32:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (1.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 1.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:40.601547"], ["name", "hello"], ["updated_at", "2015-10-27 14:32:40.601547"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:40.602782"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:40.602782"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:32:40.604017"], ["product_id", 1], ["updated_at", "2015-10-27 14:32:40.604017"]]  (3.8ms) commit transaction Redirected to http://127.0.0.1:64762/products Completed 302 Found in 12ms (ActiveRecord: 4.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (0.4ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.6ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:40.675961"], ["name", "wood"], ["updated_at", "2015-10-27 14:32:40.675961"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:40.678587"], ["name", "new parent"], ["updated_at", "2015-10-27 14:32:40.678587"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:32:40.681091"], ["name", "category_1"], ["parent_id", 1], ["updated_at", "2015-10-27 14:32:40.681091"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (7.9ms) Rendered categories/edit.html.erb within layouts/application (9.9ms) Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:40 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.4ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.8ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", "2015-10-27 14:32:41.810977"]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:64762/categories Completed 302 Found in 7ms (ActiveRecord: 2.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.4ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.5ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:41.880017"], ["name", "wood"], ["updated_at", "2015-10-27 14:32:41.880017"]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.8ms) Rendered categories/new.html.erb within layouts/application (4.5ms) Completed 200 OK in 7ms (Views: 7.2ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:41 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:32:42 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:42 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:32:42.987772"], ["name", "hello"], ["parent_id", 1], ["updated_at", "2015-10-27 14:32:42.987772"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64762/categories Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:42 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:43.052603"], ["name", "wood"], ["updated_at", "2015-10-27 14:32:43.052603"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.1ms) Rendered categories/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:32:43.068782"], ["name", "hello"], ["parent_id", 1], ["updated_at", "2015-10-27 14:32:43.068782"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:43.086515"], ["name", "wood"], ["updated_at", "2015-10-27 14:32:43.086515"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:43.089255"], ["name", "category_2"], ["updated_at", "2015-10-27 14:32:43.089255"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:32:43.091440"], ["name", "category_3"], ["parent_id", 1], ["updated_at", "2015-10-27 14:32:43.091440"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (3.9ms) Rendered categories/edit.html.erb within layouts/application (4.2ms) Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", "2015-10-27 14:32:43.108115"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:43.124056"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:43.124056"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:43.126581"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:43.126581"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:43.129048"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:43.129048"]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (28.2ms) Rendered items/new.html.erb within layouts/application (29.8ms) Completed 200 OK in 37ms (Views: 34.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:43 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:44.268371"], ["name", "hello"], ["updated_at", "2015-10-27 14:32:44.268371"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:64762/items Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 11ms (Views: 10.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.7ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:44.355109"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:44.355109"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:44.358280"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:44.358280"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:44.360981"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:44.360981"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:44.364202"], ["name", "item"], ["updated_at", "2015-10-27 14:32:44.364202"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.9ms) Rendered items/edit.html.erb within layouts/application (8.9ms) Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", "2015-10-27 14:32:45.478342"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:64762/items Completed 302 Found in 7ms (ActiveRecord: 3.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 10ms (Views: 9.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.4ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.3ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:45.550397"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:45.550397"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:45.553259"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:45.553259"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:45.555840"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:45.555840"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.1ms) Rendered items/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:45.574845"], ["name", "hello"], ["updated_at", "2015-10-27 14:32:45.574845"]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:45.595299"], ["name", "shoes"], ["updated_at", "2015-10-27 14:32:45.595299"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:45.598020"], ["name", "skirt"], ["updated_at", "2015-10-27 14:32:45.598020"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:32:45.600544"], ["name", "pents"], ["updated_at", "2015-10-27 14:32:45.600544"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:32:45.603505"], ["name", "item"], ["updated_at", "2015-10-27 14:32:45.603505"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.6ms) Rendered items/edit.html.erb within layouts/application (6.8ms) Completed 200 OK in 10ms (Views: 8.6ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", "2015-10-27 14:32:45.628829"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:45 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.5ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:32:49.453446"], ["updated_at", "2015-10-27 14:32:49.453446"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 14:32:49.459283"], ["updated_at", "2015-10-27 14:32:49.459283"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 14:32:49.461801"], ["updated_at", "2015-10-27 14:32:49.461801"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:49 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (148.7ms) Rendered categories/edit.html.erb within layouts/application (154.3ms) Completed 200 OK in 341ms (Views: 336.7ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:49 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:32:49.847197"], ["id", 3]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:49 +0100 Processing by CategoriesController#index as HTML Category Load (5.9ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (11.7ms) Completed 200 OK in 15ms (Views: 9.0ms | ActiveRecord: 5.9ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:32:49.880329"], ["updated_at", "2015-10-27 14:32:49.880329"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:49 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (4.3ms) Rendered categories/new.html.erb within layouts/application (4.9ms) Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:49 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:32:49.902814"], ["updated_at", "2015-10-27 14:32:49.902814"]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:49 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:32:49.924496"], ["updated_at", "2015-10-27 14:32:49.924496"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 14:32:49.927467"], ["updated_at", "2015-10-27 14:32:49.927467"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 14:32:49.930358"], ["updated_at", "2015-10-27 14:32:49.930358"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:32:51 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (6.7ms) Rendered categories/edit.html.erb within layouts/application (7.0ms) Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:51 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:51 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:32:51 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.3ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:32:52.445253"], ["id", 3]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:64772/categories Completed 302 Found in 7ms (ActiveRecord: 3.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:32:52.512257"], ["updated_at", "2015-10-27 14:32:52.512257"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.1ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:32:52 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:32:53.607802"], ["updated_at", "2015-10-27 14:32:53.607802"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64772/categories Completed 302 Found in 5ms (ActiveRecord: 3.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:53.670821"], ["updated_at", "2015-10-27 14:32:53.670821"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:53.673757"], ["updated_at", "2015-10-27 14:32:53.673757"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:53.676409"], ["updated_at", "2015-10-27 14:32:53.676409"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (31.2ms) Rendered items/new.html.erb within layouts/application (32.9ms) Completed 200 OK in 43ms (Views: 36.5ms | ActiveRecord: 0.7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:53 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:32:54.819611"], ["updated_at", "2015-10-27 14:32:54.819611"]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:64772/items Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:54.887743"], ["updated_at", "2015-10-27 14:32:54.887743"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:54.891149"], ["updated_at", "2015-10-27 14:32:54.891149"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:54.894132"], ["updated_at", "2015-10-27 14:32:54.894132"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:32:54.897654"], ["updated_at", "2015-10-27 14:32:54.897654"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.1ms) Rendered items/edit.html.erb within layouts/application (8.0ms) Completed 200 OK in 12ms (Views: 10.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:54 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.6ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:32:56.012803"], ["id", 1]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64772/items Completed 302 Found in 7ms (ActiveRecord: 3.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Item Load (1.9ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.2ms) DELETE FROM "products";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.3ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:56.096015"], ["updated_at", "2015-10-27 14:32:56.096015"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:56.100062"], ["updated_at", "2015-10-27 14:32:56.100062"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:56.103100"], ["updated_at", "2015-10-27 14:32:56.103100"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:32:56.106825"], ["updated_at", "2015-10-27 14:32:56.106825"]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.6ms) Rendered items/edit.html.erb within layouts/application (7.0ms) Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:32:56.130968"], ["id", 1]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#index as HTML Item Load (0.4ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.4ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:56.150394"], ["updated_at", "2015-10-27 14:32:56.150394"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:56.153439"], ["updated_at", "2015-10-27 14:32:56.153439"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:56.156898"], ["updated_at", "2015-10-27 14:32:56.156898"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.1ms) Rendered items/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:32:56.179357"], ["updated_at", "2015-10-27 14:32:56.179357"]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:56.200803"], ["updated_at", "2015-10-27 14:32:56.200803"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:56.204286"], ["updated_at", "2015-10-27 14:32:56.204286"]]  (1.0ms) commit transaction  (0.6ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:56.208509"], ["updated_at", "2015-10-27 14:32:56.208509"]]  (1.0ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (26.0ms) Rendered products/new.html.erb within layouts/application (28.0ms) Completed 200 OK in 40ms (Views: 31.8ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:32:56.278096"], ["updated_at", "2015-10-27 14:32:56.278096"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:32:56.279998"], ["updated_at", "2015-10-27 14:32:56.279998"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:32:56.281855"], ["updated_at", "2015-10-27 14:32:56.281855"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 19ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (12.1ms) Completed 200 OK in 16ms (Views: 14.9ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:56.317951"], ["updated_at", "2015-10-27 14:32:56.317951"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:56.320678"], ["updated_at", "2015-10-27 14:32:56.320678"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:56.323337"], ["updated_at", "2015-10-27 14:32:56.323337"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:32:56.329706"], ["updated_at", "2015-10-27 14:32:56.329706"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:32:56.332076"], ["updated_at", "2015-10-27 14:32:56.332076"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:32:56.333652"], ["updated_at", "2015-10-27 14:32:56.333652"]]  (1.3ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (10.8ms) Rendered products/edit.html.erb within layouts/application (11.4ms) Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.8ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:32:56.370310"], ["updated_at", "2015-10-27 14:32:56.370310"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#index as HTML Product Load (0.3ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:56.392324"], ["updated_at", "2015-10-27 14:32:56.392324"]]  (0.9ms) commit transaction  (0.2ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:56.395528"], ["updated_at", "2015-10-27 14:32:56.395528"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:56.398407"], ["updated_at", "2015-10-27 14:32:56.398407"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:32:56.404647"], ["updated_at", "2015-10-27 14:32:56.404647"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:32:56.406407"], ["updated_at", "2015-10-27 14:32:56.406407"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:32:56.407665"], ["updated_at", "2015-10-27 14:32:56.407665"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (12.6ms) Rendered products/edit.html.erb within layouts/application (12.8ms) Completed 200 OK in 15ms (Views: 14.4ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:32:56 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:57 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:32:58.546690"], ["updated_at", "2015-10-27 14:32:58.546690"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:64772/products Completed 302 Found in 10ms (ActiveRecord: 3.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:32:58.608034"], ["updated_at", "2015-10-27 14:32:58.608034"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:32:58.610888"], ["updated_at", "2015-10-27 14:32:58.610888"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:32:58.613557"], ["updated_at", "2015-10-27 14:32:58.613557"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.6ms) Rendered products/new.html.erb within layouts/application (3.8ms) Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:32:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:33:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:33:00 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:33:00.761451"], ["updated_at", "2015-10-27 14:33:00.761451"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:33:00.763886"], ["updated_at", "2015-10-27 14:33:00.763886"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:33:00.767079"], ["updated_at", "2015-10-27 14:33:00.767079"]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:64772/products Completed 302 Found in 18ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:33:00 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.7ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:33:00 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:33:00 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 Category Load (0.8ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]]  (2.6ms) DELETE FROM "categories";  (0.5ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.3ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (6.0ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:50 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:50 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:50 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:50 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:50 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:50 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:42:50 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (96.3ms) Rendered categories/edit.html.erb within layouts/application (103.3ms) Completed 200 OK in 116.5ms (Views: 115.1ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:42:51 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:42:51.093307' WHERE "categories"."id" = 3  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 7.9ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:42:51 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 5.4ms (Views: 4.2ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:51 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:51 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:42:51 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.0ms) Rendered categories/new.html.erb within layouts/application (3.6ms) Completed 200 OK in 6.1ms (Views: 5.7ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:42:51 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:51 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:51 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.6ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:42:51 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3.0ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:51 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:51 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:42:52 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.3ms) Rendered categories/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 4.9ms (Views: 4.7ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:42:53 +0100 Served asset /application.css - 200 OK (9ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:42:53 +0100 Served asset /application.js - 200 OK (10ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:42:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2.6ms (Views: 0.2ms | ActiveRecord: 0.5ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:42:54 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64933/categories Completed 302 Found in 4.8ms (ActiveRecord: 3.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:42:54 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.5ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:54 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:42:54 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (4.7ms) Completed 200 OK in 7.0ms (Views: 5.8ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:42:54 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 15:42:55 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 14:42:55.306739' WHERE "categories"."id" = 3  (3.3ms) commit transaction Redirected to http://127.0.0.1:64933/categories Completed 302 Found in 6.3ms (ActiveRecord: 3.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:42:55 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3.5ms (Views: 2.6ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:55 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:55 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:55 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:55 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:55 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:55 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:42:55 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (26.0ms) Rendered items/new.html.erb within layouts/application (27.6ms) Completed 200 OK in 38.1ms (Views: 33.1ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:42:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.7ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:42:56 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64933/items Completed 302 Found in 8.5ms (ActiveRecord: 3.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:42:56 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 5.2ms (Views: 3.7ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:42:56 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:42:56 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (6.1ms) Rendered items/edit.html.erb within layouts/application (6.6ms) Completed 200 OK in 9.8ms (Views: 8.6ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:42:56 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.6ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:42:57.701194' WHERE "items"."id" = 1  (3.1ms) commit transaction Redirected to http://127.0.0.1:64933/items Completed 302 Found in 6.8ms (ActiveRecord: 3.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3.1ms (Views: 2.1ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.1ms) Rendered items/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 6.7ms (Views: 6.4ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.0ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 2.6ms (Views: 1.9ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (5.9ms) Rendered items/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 8.1ms (Views: 7.1ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 14:42:57.822911' WHERE "items"."id" = 1  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.8ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 2.9ms (Views: 2.1ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (19.9ms) Rendered products/new.html.erb within layouts/application (21.3ms) Completed 200 OK in 30.5ms (Views: 26.4ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]] SQL (0.7ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 21.9ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (14.8ms) Completed 200 OK in 19.7ms (Views: 18.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.8ms) commit transaction  (0.5ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (8.2ms) Rendered products/edit.html.erb within layouts/application (8.9ms) Completed 200 OK in 13.4ms (Views: 11.8ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:42:57 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:57 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10.0ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:42:58 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 13.6ms (Views: 12.6ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:42:58 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:42:58 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.9ms) Rendered products/edit.html.erb within layouts/application (7.1ms) Completed 200 OK in 9.7ms (Views: 8.0ms | ActiveRecord: 0.8ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:42:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:42:59 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 15:43:00 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64933/products Completed 302 Found in 9.5ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:00 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4.3ms (Views: 3.4ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 14:43:00 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:00 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.3ms) Rendered products/new.html.erb within layouts/application (3.6ms) Completed 200 OK in 5.2ms (Views: 4.9ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.5ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:43:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 0.9ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:02 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:02 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:43:02 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:02 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:02 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:43:02 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:02 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:64933/products Completed 302 Found in 10.5ms (ActiveRecord: 4.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:02 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4.0ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (3.8ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (1.0ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:43:06 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (183.4ms) Rendered items/new.html.erb within layouts/application (188.9ms) Completed 200 OK in 418ms (Views: 415.0ms | ActiveRecord: 0.3ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:43:06 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:06 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:43:06 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (10.9ms) Rendered items/edit.html.erb within layouts/application (11.9ms) Completed 200 OK in 18ms (Views: 16.3ms | ActiveRecord: 0.5ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:43:06 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction SQL (0.6ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 7ms (ActiveRecord: 2.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:06 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 14:43:06 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:43:08 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.8ms) Rendered items/edit.html.erb within layouts/application (7.1ms) Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.8ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:08 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:08 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64948/items Completed 302 Found in 6ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:09 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.1ms) Rendered items/new.html.erb within layouts/application (5.6ms) Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:09 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:10 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64948/items Completed 302 Found in 5ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (24.1ms) Rendered products/new.html.erb within layouts/application (25.9ms) Completed 200 OK in 35ms (Views: 29.4ms | ActiveRecord: 0.4ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 17ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (13.5ms) Completed 200 OK in 17ms (Views: 16.0ms | ActiveRecord: 0.4ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (8.6ms) Rendered products/edit.html.erb within layouts/application (9.3ms) Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.8ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.4ms) Completed 200 OK in 27ms (Views: 26.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.8ms) commit transaction  (0.3ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:11 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.2ms) Rendered products/edit.html.erb within layouts/application (6.4ms) Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:43:11 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:12 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00]]  (2.4ms) commit transaction Redirected to http://127.0.0.1:64948/products Completed 302 Found in 9ms (ActiveRecord: 3.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 14:43:13 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.5ms) Rendered products/new.html.erb within layouts/application (4.7ms) Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:13 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:43:14 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.2ms) begin transaction SQL (1.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:64948/products Completed 302 Found in 10ms (ActiveRecord: 2.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (5.1ms) Rendered categories/new.html.erb within layouts/application (7.0ms) Completed 200 OK in 11ms (Views: 10.9ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.3ms) Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.4ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (1.2ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "category_1"], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (6.2ms) Rendered categories/edit.html.erb within layouts/application (7.3ms) Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (6.5ms) Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:43:15 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Rendered categories/new.html.erb within layouts/application (4.2ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:15 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:43:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:43:16 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:16 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:16 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:64948/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:16 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:16 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:16 +0100 Category Load (0.8ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:17 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 14:43:17 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:17 UTC +00:00], ["name", "new parent"], ["updated_at", Tue, 27 Oct 2015 14:43:17 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 14:43:17 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 14:43:17 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:43:17 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (5.2ms) Rendered categories/edit.html.erb within layouts/application (5.5ms) Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:17 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:43:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:43:18 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", Tue, 27 Oct 2015 14:43:18 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:64948/categories Completed 302 Found in 6ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:18 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:18 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:18 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:22.052379"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:22.052379"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:22.057846"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:22.057846"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:22.059837"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:22.059837"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:22.095730"], ["name", "product"], ["updated_at", "2015-10-27 14:43:22.095730"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:22.097158"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:22.097158"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:43:22.098185"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:22.098185"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:43:23 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (134.9ms) Rendered products/edit.html.erb within layouts/application (140.8ms) Completed 200 OK in 348ms (Views: 344.0ms | ActiveRecord: 1.1ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:23 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:23 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:43:24 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:25 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:43:25 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", "2015-10-27 14:43:25.976099"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:25.976099"]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:64958/products Completed 302 Found in 14ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:25 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:25 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:26 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:26.039915"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:26.039915"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:26.042678"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:26.042678"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:26.044935"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:26.044935"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:26 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.9ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:26 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:26 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:26 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:43:27 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.177790"], ["name", "hello"], ["updated_at", "2015-10-27 14:43:28.177790"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:28.179359"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.179359"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:43:28.181119"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.181119"]]  (3.7ms) commit transaction Redirected to http://127.0.0.1:64958/products Completed 302 Found in 13ms (ActiveRecord: 4.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.0ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Product Load (0.5ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (2.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.264864"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:28.264864"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.267909"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:28.267909"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.270885"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:28.270885"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.276954"], ["name", "product"], ["updated_at", "2015-10-27 14:43:28.276954"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:28.278566"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.278566"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:43:28.279746"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.279746"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (9.5ms) Rendered products/edit.html.erb within layouts/application (9.7ms) Completed 200 OK in 13ms (Views: 11.7ms | ActiveRecord: 0.6ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", "2015-10-27 14:43:28.316884"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.316884"]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 11ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#index as HTML Product Load (0.5ms) SELECT "products".* FROM "products"  (0.5ms) SELECT "categories".id FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 1.0ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.3ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.342458"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:28.342458"]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.345592"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:28.345592"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.348066"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:28.348066"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.8ms) Rendered products/new.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.369034"], ["name", "hello"], ["updated_at", "2015-10-27 14:43:28.369034"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 14:43:28.370532"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.370532"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:28.371396"], ["product_id", 1], ["updated_at", "2015-10-27 14:43:28.371396"]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 1.9ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.1ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.399818"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:28.399818"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.402482"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:28.402482"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:28.404935"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:28.404935"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (39.0ms) Rendered items/new.html.erb within layouts/application (41.3ms) Completed 200 OK in 49ms (Views: 45.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:28 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:29.563581"], ["name", "hello"], ["updated_at", "2015-10-27 14:43:29.563581"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:64958/items Completed 302 Found in 7ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.2ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:29.650220"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:29.650220"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:29.653383"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:29.653383"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:29.656331"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:29.656331"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:29.659538"], ["name", "item"], ["updated_at", "2015-10-27 14:43:29.659538"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (6.1ms) Rendered items/edit.html.erb within layouts/application (6.9ms) Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:29 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", "2015-10-27 14:43:30.804827"]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:64958/items Completed 302 Found in 8ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Item Load (0.3ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.875152"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:30.875152"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.877800"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:30.877800"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.880689"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:30.880689"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (7.2ms) Rendered items/new.html.erb within layouts/application (7.5ms) Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:30.900503"], ["name", "hello"], ["updated_at", "2015-10-27 14:43:30.900503"]]  (1.0ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.918646"], ["name", "shoes"], ["updated_at", "2015-10-27 14:43:30.918646"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.921867"], ["name", "skirt"], ["updated_at", "2015-10-27 14:43:30.921867"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.924249"], ["name", "pents"], ["updated_at", "2015-10-27 14:43:30.924249"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 14:43:30.926932"], ["name", "item"], ["updated_at", "2015-10-27 14:43:30.926932"]]  (0.5ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.6ms) Rendered items/edit.html.erb within layouts/application (7.8ms) Completed 200 OK in 11ms (Views: 9.9ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", "2015-10-27 14:43:30.951399"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.969691"], ["name", "wood"], ["updated_at", "2015-10-27 14:43:30.969691"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:30.973194"], ["name", "category_1"], ["updated_at", "2015-10-27 14:43:30.973194"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:43:30.976318"], ["name", "category_2"], ["parent_id", 1], ["updated_at", "2015-10-27 14:43:30.976318"]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:43:30 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (7.6ms) Rendered categories/edit.html.erb within layouts/application (10.0ms) Completed 200 OK in 16ms (Views: 14.7ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", "2015-10-27 14:43:31.011815"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (3.1ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.4ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:31.032525"], ["name", "wood"], ["updated_at", "2015-10-27 14:43:31.032525"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.8ms) Rendered categories/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:43:31.053720"], ["name", "hello"], ["parent_id", 1], ["updated_at", "2015-10-27 14:43:31.053720"]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:31.076421"], ["name", "wood"], ["updated_at", "2015-10-27 14:43:31.076421"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:31.079458"], ["name", "new parent"], ["updated_at", "2015-10-27 14:43:31.079458"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:43:31.082157"], ["name", "category_3"], ["parent_id", 1], ["updated_at", "2015-10-27 14:43:31.082157"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (6.7ms) Rendered categories/edit.html.erb within layouts/application (6.9ms) Completed 200 OK in 10ms (Views: 8.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:43:31 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", "2015-10-27 14:43:32.204508"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:64958/categories Completed 302 Found in 6ms (ActiveRecord: 3.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.4ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 14:43:32.271584"], ["name", "wood"], ["updated_at", "2015-10-27 14:43:32.271584"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Rendered categories/new.html.erb within layouts/application (4.1ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:43:32 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:43:33 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 14:43:33.375294"], ["name", "hello"], ["parent_id", 1], ["updated_at", "2015-10-27 14:43:33.375294"]]  (2.6ms) commit transaction Redirected to http://127.0.0.1:64958/categories Completed 302 Found in 6ms (ActiveRecord: 3.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:33 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:33 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:33 +0100 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:37.224969"], ["updated_at", "2015-10-27 14:43:37.224969"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:37.230741"], ["updated_at", "2015-10-27 14:43:37.230741"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:37.233143"], ["updated_at", "2015-10-27 14:43:37.233143"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:38 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (137.4ms) Rendered products/new.html.erb within layouts/application (142.8ms) Completed 200 OK in 417ms (Views: 409.4ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:39 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:39 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:39 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 15:43:40 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:43:41.318001"], ["updated_at", "2015-10-27 14:43:41.318001"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:43:41.319875"], ["updated_at", "2015-10-27 14:43:41.319875"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:43:41.321509"], ["updated_at", "2015-10-27 14:43:41.321509"]]  (1.1ms) commit transaction Redirected to http://127.0.0.1:64969/products Completed 302 Found in 24ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (17.7ms) Completed 200 OK in 23ms (Views: 22.4ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:41.434960"], ["updated_at", "2015-10-27 14:43:41.434960"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:41.439990"], ["updated_at", "2015-10-27 14:43:41.439990"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:41.443780"], ["updated_at", "2015-10-27 14:43:41.443780"]]  (0.6ms) commit transaction Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:43:41.454234"], ["updated_at", "2015-10-27 14:43:41.454234"]] SQL (1.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:43:41.456864"], ["updated_at", "2015-10-27 14:43:41.456864"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:43:41.459292"], ["updated_at", "2015-10-27 14:43:41.459292"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (9.3ms) Rendered products/edit.html.erb within layouts/application (10.0ms) Completed 200 OK in 15ms (Views: 13.5ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:43:41 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2ms (Views: 0.6ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:42 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:43:43.610109"], ["updated_at", "2015-10-27 14:43:43.610109"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:64969/products Completed 302 Found in 12ms (ActiveRecord: 4.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.3ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:43.681889"], ["updated_at", "2015-10-27 14:43:43.681889"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:43.684687"], ["updated_at", "2015-10-27 14:43:43.684687"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:43.687095"], ["updated_at", "2015-10-27 14:43:43.687095"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 14:43:43.692197"], ["updated_at", "2015-10-27 14:43:43.692197"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:43:43.693558"], ["updated_at", "2015-10-27 14:43:43.693558"]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:43:43.694731"], ["updated_at", "2015-10-27 14:43:43.694731"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (5.3ms) Rendered products/edit.html.erb within layouts/application (5.5ms) Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.4ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 14:43:43.724536"], ["updated_at", "2015-10-27 14:43:43.724536"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:43.744504"], ["updated_at", "2015-10-27 14:43:43.744504"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:43.747361"], ["updated_at", "2015-10-27 14:43:43.747361"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:43.750349"], ["updated_at", "2015-10-27 14:43:43.750349"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.1ms) Rendered products/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 14:43:43.768896"], ["updated_at", "2015-10-27 14:43:43.768896"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 14:43:43.770198"], ["updated_at", "2015-10-27 14:43:43.770198"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 14:43:43.771205"], ["updated_at", "2015-10-27 14:43:43.771205"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:43:43.791135"], ["updated_at", "2015-10-27 14:43:43.791135"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.4ms) Rendered categories/new.html.erb within layouts/application (5.2ms) Completed 200 OK in 9ms (Views: 8.9ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:43 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:43:44.888482"], ["updated_at", "2015-10-27 14:43:44.888482"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:64969/categories Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:43:44.951218"], ["updated_at", "2015-10-27 14:43:44.951218"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 14:43:44.954102"], ["updated_at", "2015-10-27 14:43:44.954102"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_1"], ["parent_id", 1], ["created_at", "2015-10-27 14:43:44.956589"], ["updated_at", "2015-10-27 14:43:44.956589"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.4ms) Rendered categories/edit.html.erb within layouts/application (5.2ms) Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:44 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 15:43:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:43:46.062799"], ["id", 3]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:64969/categories Completed 302 Found in 7ms (ActiveRecord: 3.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.3ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.5ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:43:46.122321"], ["updated_at", "2015-10-27 14:43:46.122321"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_2"], ["created_at", "2015-10-27 14:43:46.125226"], ["updated_at", "2015-10-27 14:43:46.125226"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 14:43:46.127811"], ["updated_at", "2015-10-27 14:43:46.127811"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (5.5ms) Rendered categories/edit.html.erb within layouts/application (5.7ms) Completed 200 OK in 8ms (Views: 6.8ms | ActiveRecord: 0.3ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 14:43:46.147592"], ["id", 3]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 14:43:46.162659"], ["updated_at", "2015-10-27 14:43:46.162659"]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.5ms) Rendered categories/new.html.erb within layouts/application (2.7ms) Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 14:43:46.177885"], ["updated_at", "2015-10-27 14:43:46.177885"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:46.195439"], ["updated_at", "2015-10-27 14:43:46.195439"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:46.198208"], ["updated_at", "2015-10-27 14:43:46.198208"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:46.200661"], ["updated_at", "2015-10-27 14:43:46.200661"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:43:46.208734"], ["updated_at", "2015-10-27 14:43:46.208734"]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (25.5ms) Rendered items/edit.html.erb within layouts/application (26.9ms) Completed 200 OK in 32ms (Views: 30.5ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:43:46.257096"], ["id", 1]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:46.275375"], ["updated_at", "2015-10-27 14:43:46.275375"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:46.278528"], ["updated_at", "2015-10-27 14:43:46.278528"]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:46.281248"], ["updated_at", "2015-10-27 14:43:46.281248"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.7ms) Rendered items/new.html.erb within layouts/application (5.3ms) Completed 200 OK in 8ms (Views: 7.7ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:43:46.301320"], ["updated_at", "2015-10-27 14:43:46.301320"]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.2ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:46.323145"], ["updated_at", "2015-10-27 14:43:46.323145"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:46.326849"], ["updated_at", "2015-10-27 14:43:46.326849"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:46.329895"], ["updated_at", "2015-10-27 14:43:46.329895"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 14:43:46.333040"], ["updated_at", "2015-10-27 14:43:46.333040"]]  (0.6ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (14.1ms) Rendered items/edit.html.erb within layouts/application (14.3ms) Completed 200 OK in 16ms (Views: 15.4ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 15:43:46 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 14:43:47.441875"], ["id", 1]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:64969/items Completed 302 Found in 5ms (ActiveRecord: 2.9ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 14:43:47.501138"], ["updated_at", "2015-10-27 14:43:47.501138"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 14:43:47.504323"], ["updated_at", "2015-10-27 14:43:47.504323"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 14:43:47.507341"], ["updated_at", "2015-10-27 14:43:47.507341"]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.9ms) Rendered items/new.html.erb within layouts/application (5.1ms) Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 15:43:47 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 15:43:48 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 14:43:48.606976"], ["updated_at", "2015-10-27 14:43:48.606976"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:64969/items Completed 302 Found in 6ms (ActiveRecord: 3.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 15:43:48 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.0ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 15:43:48 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 15:43:48 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (7.1ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:50 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:50 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:50 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:50 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:50 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:50 UTC +00:00]]  (1.3ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:00:52 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (97.7ms) Rendered categories/edit.html.erb within layouts/application (103.0ms) Completed 200 OK in 116.6ms (Views: 114.6ms | ActiveRecord: 0.7ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:00:52 +0100 Served asset /application.css - 200 OK (10ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:00:52 +0100 Served asset /application.js - 200 OK (10ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 16:00:52 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2.4ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 16:00:53 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction  (0.4ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 15:00:53.367641' WHERE "categories"."id" = 3  (0.9ms) commit transaction Redirected to http://127.0.0.1:65371/categories Completed 302 Found in 7.7ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:00:53 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 14.4ms (Views: 13.3ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:53 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:53 UTC +00:00]]  (1.2ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:00:53 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.4ms) Rendered categories/new.html.erb within layouts/application (4.1ms) Completed 200 OK in 6.7ms (Views: 6.3ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 16:00:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (2.3ms) commit transaction Redirected to http://127.0.0.1:65371/categories Completed 302 Found in 5.2ms (ActiveRecord: 2.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3.1ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "category_2"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (4.6ms) Completed 200 OK in 6.7ms (Views: 5.7ms | ActiveRecord: 0.2ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 15:00:54.611979' WHERE "categories"."id" = 3  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.5ms (ActiveRecord: 1.2ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3.7ms (Views: 2.6ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (1.1ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.5ms) Rendered categories/new.html.erb within layouts/application (3.7ms) Completed 200 OK in 5.2ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 2.8ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3.6ms (Views: 2.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.1ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.8ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.9ms) commit transaction  (0.2ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 15:00:54 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:00:54 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (36.3ms) Rendered items/edit.html.erb within layouts/application (37.8ms) Completed 200 OK in 45.9ms (Views: 43.2ms | ActiveRecord: 0.5ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:00:55 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.6ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 16:00:55 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction  (0.5ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 15:00:55.834948' WHERE "items"."id" = 1  (2.8ms) commit transaction Redirected to http://127.0.0.1:65371/items Completed 302 Found in 10.2ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:00:55 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 6.3ms (Views: 4.0ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:55 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:55 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:55 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:55 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:55 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:55 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:00:55 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.0ms) Rendered items/new.html.erb within layouts/application (6.6ms) Completed 200 OK in 10.0ms (Views: 9.6ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:00:56 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:65371/items Completed 302 Found in 6.2ms (ActiveRecord: 4.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3.2ms (Views: 2.2ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (2.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (20.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (2.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.6ms) Rendered items/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 6.1ms (Views: 5.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (1.3ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.4ms (ActiveRecord: 1.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2.4ms (Views: 1.8ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (6.0ms) Rendered items/edit.html.erb within layouts/application (6.2ms) Completed 200 OK in 8.5ms (Views: 7.4ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 15:00:57.173864' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3.7ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 2.5ms (Views: 1.9ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (16.7ms) Rendered products/edit.html.erb within layouts/application (18.7ms) Completed 200 OK in 24.7ms (Views: 23.0ms | ActiveRecord: 0.6ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10.5ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.6ms) Completed 200 OK in 5.8ms (Views: 4.7ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (1.1ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.6ms) Rendered products/new.html.erb within layouts/application (4.3ms) Completed 200 OK in 7.4ms (Views: 7.0ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7.2ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 8.0ms (Views: 7.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (1.3ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.2ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:57 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.3ms) Rendered products/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 5.0ms (Views: 4.8ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:00:57 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 16:00:58 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2.1ms (Views: 0.8ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:00:59 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://127.0.0.1:65371/products Completed 302 Found in 7.4ms (ActiveRecord: 2.3ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:00:59 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 4.5ms (Views: 2.9ms | ActiveRecord: 0.5ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:00:59 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:00:59 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (7.0ms) Rendered products/edit.html.erb within layouts/application (7.2ms) Completed 200 OK in 9.4ms (Views: 8.1ms | ActiveRecord: 0.6ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:00:59 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:01:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 16:01:01 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 15:01:01 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:01:01 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:65371/products Completed 302 Found in 9.8ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:01:01 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3.9ms (Views: 2.8ms | ActiveRecord: 0.4ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items'; Connecting to database specified by database.yml  (0.1ms) begin transaction SQL (8.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00]]  (3.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00]]  (1.2ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:27 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:46:29 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = 1 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 Rendered products/_form.html.erb (120.2ms) Rendered products/edit.html.erb within layouts/application (125.2ms) Completed 200 OK in 140.6ms (Views: 136.7ms | ActiveRecord: 1.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:29 +0100 Served asset /application.css - 200 OK (8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:29 +0100 Served asset /application.js - 200 OK (9ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:46:30 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 2.0ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:46:31 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 0.9ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 16:46:32 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:50134/products Completed 302 Found in 13.0ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:32 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 6.3ms (Views: 4.9ms | ActiveRecord: 0.3ms) Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:32 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:46:32 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.5ms) Rendered products/new.html.erb within layouts/application (4.1ms) Completed 200 OK in 6.9ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:46:32 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 16:46:33 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1.0ms (Views: 0.2ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (2.5ms) commit transaction Redirected to http://127.0.0.1:50134/products Completed 302 Found in 8.6ms (ActiveRecord: 3.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3.7ms (Views: 2.7ms | ActiveRecord: 0.3ms) Product Load (0.4ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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  (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 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 Rendered products/_form.html.erb (6.6ms) Rendered products/edit.html.erb within layouts/application (6.8ms) Completed 200 OK in 9.0ms (Views: 7.9ms | ActiveRecord: 0.5ms) Started PUT "/products/1" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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 SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = 1 AND "product_has_categories"."category_id" = 3 SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.7ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"  (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 Rendered products/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3.2ms (Views: 2.4ms | ActiveRecord: 0.2ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.1ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.6ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.4ms) Rendered products/new.html.erb within layouts/application (3.6ms) Completed 200 OK in 5.3ms (Views: 5.1ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (1.2ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 6.9ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ProductsController#index as HTML Product Load (0.1ms) SELECT "products".* FROM "products"   (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 Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3.8ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 15:46:34 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (28.0ms) Rendered items/edit.html.erb within layouts/application (29.6ms) Completed 200 OK in 36.5ms (Views: 34.5ms | ActiveRecord: 0.4ms) Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:46:34 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1.5ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 16:46:35 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.4ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 15:46:35.581360' WHERE "items"."id" = 1  (2.7ms) commit transaction Redirected to http://127.0.0.1:50134/items Completed 302 Found in 8.3ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:35 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 5.0ms (Views: 3.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.6ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:35 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:35 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:35 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:35 UTC +00:00]]  (0.5ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:35 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:35 UTC +00:00]]  (0.6ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:46:35 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.0ms) Rendered items/new.html.erb within layouts/application (6.5ms) Completed 200 OK in 9.5ms (Views: 9.0ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (3.1ms) commit transaction Redirected to http://127.0.0.1:50134/items Completed 302 Found in 5.8ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.8ms) Completed 200 OK in 3.2ms (Views: 2.3ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.5ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered items/_form.html.erb (7.6ms) Rendered items/edit.html.erb within layouts/application (7.8ms) Completed 200 OK in 10.3ms (Views: 9.0ms | ActiveRecord: 0.6ms) Started PUT "/items/1" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "items" SET "category_id" = 2, "updated_at" = '2015-10-27 15:46:36.821469' WHERE "items"."id" = 1  (1.0ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4.6ms (ActiveRecord: 1.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#index as HTML Item Load (0.1ms) SELECT "items".* FROM "items"  Rendered items/index.html.erb within layouts/application (0.6ms) Completed 200 OK in 3.3ms (Views: 2.7ms | ActiveRecord: 0.1ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "shoes"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "skirt"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "pents"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.5ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.3ms) Rendered items/new.html.erb within layouts/application (6.5ms) Completed 200 OK in 8.1ms (Views: 7.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 2.9ms (ActiveRecord: 1.1ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.7ms) Completed 200 OK in 3.2ms (Views: 2.4ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.6ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (6.6ms) Rendered categories/new.html.erb within layouts/application (8.4ms) Completed 200 OK in 15.0ms (Views: 14.4ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5.0ms (ActiveRecord: 1.3ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories"  Rendered categories/index.html.erb within layouts/application (12.1ms) Completed 200 OK in 15.4ms (Views: 14.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.6ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.6ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "category_1"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "category_2"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.5ms) Rendered categories/edit.html.erb within layouts/application (5.2ms) Completed 200 OK in 8.4ms (Views: 7.1ms | ActiveRecord: 0.3ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 15:46:36.981394' WHERE "categories"."id" = 3  (0.6ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3.7ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:36 +0100 Processing by CategoriesController#index as HTML Category Load (0.1ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 3.6ms (Views: 2.9ms | ActiveRecord: 0.1ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:36 UTC +00:00]]  (0.7ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:46:37 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.1ms) Rendered categories/new.html.erb within layouts/application (3.3ms) Completed 200 OK in 4.6ms (Views: 4.4ms | ActiveRecord: 0.0ms) Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 16:46:37 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:46:38 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00]]  (3.5ms) commit transaction Redirected to http://127.0.0.1:50134/categories Completed 302 Found in 5.7ms (ActiveRecord: 4.0ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:38 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00], ["name", "wood"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00], ["name", "new parent"], ["parent_id", nil], ["updated_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:38 UTC +00:00]]  (1.0ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:46:38 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1 LIMIT 1 Rendered categories/_form.html.erb (4.1ms) Rendered categories/edit.html.erb within layouts/application (4.3ms) Completed 200 OK in 6.3ms (Views: 5.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 16:46:38 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1.1ms (Views: 0.1ms | ActiveRecord: 0.1ms) Started PUT "/categories/3" for 127.0.0.1 at 2015-10-27 16:46:39 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.0ms) begin transaction  (0.3ms) UPDATE "categories" SET "parent_id" = 2, "updated_at" = '2015-10-27 15:46:39.227892' WHERE "categories"."id" = 3  (3.1ms) commit transaction Redirected to http://127.0.0.1:50134/categories Completed 302 Found in 5.9ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:39 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3.4ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 2 LIMIT 1  (2.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (4.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:42 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 15:46:42 UTC +00:00]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:46:44 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (150.7ms) Rendered categories/new.html.erb within layouts/application (158.2ms) Completed 200 OK in 344ms (Views: 343.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:44 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:44 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.4ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.9ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:50148/categories Completed 302 Found in 5ms (ActiveRecord: 1.9ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Category Load (0.3ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00], ["name", "new parent"], ["updated_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00], ["name", "category_1"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:45 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (5.1ms) Rendered categories/edit.html.erb within layouts/application (5.7ms) Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:45 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 16:46:46 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 16:46:46 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", Tue, 27 Oct 2015 15:46:46 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:50148/categories Completed 302 Found in 5ms (ActiveRecord: 1.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:46 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "category_2"], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "category_3"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.1ms) Rendered categories/edit.html.erb within layouts/application (4.3ms) Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", "3"]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 4ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.5ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'products';  (1.1ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "wood"], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (2.9ms) Rendered categories/new.html.erb within layouts/application (3.1ms) Completed 200 OK in 4ms (Views: 4.3ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "hello"], ["parent_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.3ms) Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:47 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (21.5ms) Rendered products/new.html.erb within layouts/application (23.0ms) Completed 200 OK in 30ms (Views: 26.0ms | ActiveRecord: 0.5ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:46:47 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 16:46:48 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:50148/products Completed 302 Found in 18ms (ActiveRecord: 4.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (18.1ms) Completed 200 OK in 21ms (Views: 19.9ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.5ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:49 UTC +00:00]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.6ms) Rendered products/edit.html.erb within layouts/application (7.1ms) Completed 200 OK in 10ms (Views: 8.8ms | ActiveRecord: 0.7ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:46:49 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:46:50 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (1.0ms) commit transaction Redirected to http://127.0.0.1:50148/products Completed 302 Found in 12ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (5.1ms) Rendered products/new.html.erb within layouts/application (5.5ms) Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (1.1ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 2.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.9ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "product"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.9ms) Rendered products/edit.html.erb within layouts/application (7.1ms) Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.6ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["product_id", 1], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.2ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.9ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.8ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:51 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (30.5ms) Rendered items/new.html.erb within layouts/application (32.0ms) Completed 200 OK in 38ms (Views: 35.4ms | ActiveRecord: 0.4ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:51 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:50148/items Completed 302 Found in 7ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (3.7ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 15:46:52 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.4ms) Rendered items/edit.html.erb within layouts/application (8.0ms) Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:52 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:46:53 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.6ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.6ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:50148/items Completed 302 Found in 13ms (ActiveRecord: 4.0ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.9ms) Rendered items/new.html.erb within layouts/application (5.5ms) Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "hello"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.2ms) Item Load (0.3ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (1.0ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "shoes"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.6ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "skirt"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (1.1ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "pents"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00], ["name", "item"], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (12.8ms) Rendered items/edit.html.erb within layouts/application (13.2ms) Completed 200 OK in 17ms (Views: 15.5ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) begin transaction SQL (0.5ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", Tue, 27 Oct 2015 15:46:54 UTC +00:00]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:54 +0100 Processing by ItemsController#index as HTML Item Load (0.3ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.3ms) Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.245493"], ["name", "shoes"], ["updated_at", "2015-10-27 15:46:58.245493"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.251146"], ["name", "skirt"], ["updated_at", "2015-10-27 15:46:58.251146"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.253465"], ["name", "pents"], ["updated_at", "2015-10-27 15:46:58.253465"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:46:58.260970"], ["name", "item"], ["updated_at", "2015-10-27 15:46:58.260970"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:46:58 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (127.7ms) Rendered items/edit.html.erb within layouts/application (132.7ms) Completed 200 OK in 285ms (Views: 283.7ms | ActiveRecord: 0.3ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 16:46:58 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", "2015-10-27 15:46:58.582006"]]  (2.7ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 6ms (ActiveRecord: 3.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:58 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.6ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.2ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.602607"], ["name", "shoes"], ["updated_at", "2015-10-27 15:46:58.602607"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.605181"], ["name", "skirt"], ["updated_at", "2015-10-27 15:46:58.605181"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.607377"], ["name", "pents"], ["updated_at", "2015-10-27 15:46:58.607377"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:46:58 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (4.4ms) Rendered items/new.html.erb within layouts/application (5.0ms) Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:46:58 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:46:58.625411"], ["name", "hello"], ["updated_at", "2015-10-27 15:46:58.625411"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 3ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:46:58 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (0.9ms) Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.643742"], ["name", "shoes"], ["updated_at", "2015-10-27 15:46:58.643742"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.646366"], ["name", "skirt"], ["updated_at", "2015-10-27 15:46:58.646366"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:46:58.648727"], ["name", "pents"], ["updated_at", "2015-10-27 15:46:58.648727"]]  (0.8ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:46:59 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (6.5ms) Rendered items/new.html.erb within layouts/application (6.8ms) Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:00 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:00 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:47:00 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.5ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:47:01.125529"], ["name", "hello"], ["updated_at", "2015-10-27 15:47:01.125529"]]  (2.8ms) commit transaction Redirected to http://127.0.0.1:50158/items Completed 302 Found in 6ms (ActiveRecord: 3.4ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.1ms) Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (2.9ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:01.206980"], ["name", "shoes"], ["updated_at", "2015-10-27 15:47:01.206980"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:01.209940"], ["name", "skirt"], ["updated_at", "2015-10-27 15:47:01.209940"]]  (1.1ms) commit transaction  (0.0ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:01.212885"], ["name", "pents"], ["updated_at", "2015-10-27 15:47:01.212885"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("category_id", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:47:01.216262"], ["name", "item"], ["updated_at", "2015-10-27 15:47:01.216262"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (11.4ms) Rendered items/edit.html.erb within layouts/application (11.7ms) Completed 200 OK in 15ms (Views: 14.1ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:47:01 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.4ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = 1 [["category_id", 2], ["updated_at", "2015-10-27 15:47:02.338250"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:50158/items Completed 302 Found in 6ms (ActiveRecord: 3.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.8ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:02.406572"], ["name", "wood"], ["updated_at", "2015-10-27 15:47:02.406572"]]  (1.0ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (7.0ms) Rendered categories/new.html.erb within layouts/application (9.5ms) Completed 200 OK in 15ms (Views: 15.0ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 16:47:02 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 15:47:03.522040"], ["name", "hello"], ["parent_id", 1], ["updated_at", "2015-10-27 15:47:03.522040"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:50158/categories Completed 302 Found in 6ms (ActiveRecord: 3.7ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.7ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:03.596066"], ["name", "wood"], ["updated_at", "2015-10-27 15:47:03.596066"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:03.599526"], ["name", "new parent"], ["updated_at", "2015-10-27 15:47:03.599526"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 15:47:03.602914"], ["name", "category_1"], ["parent_id", 1], ["updated_at", "2015-10-27 15:47:03.602914"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.9ms) Rendered categories/edit.html.erb within layouts/application (5.5ms) Completed 200 OK in 9ms (Views: 8.3ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 16:47:03 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_1", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (1.0ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", "2015-10-27 15:47:04.723056"]]  (3.0ms) commit transaction Redirected to http://127.0.0.1:50158/categories Completed 302 Found in 7ms (ActiveRecord: 4.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.6ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (1.0ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.787147"], ["name", "wood"], ["updated_at", "2015-10-27 15:47:04.787147"]]  (0.5ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.2ms) Rendered categories/new.html.erb within layouts/application (3.4ms) Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 15:47:04.803592"], ["name", "hello"], ["parent_id", 1], ["updated_at", "2015-10-27 15:47:04.803592"]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.821941"], ["name", "wood"], ["updated_at", "2015-10-27 15:47:04.821941"]]  (1.1ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.825573"], ["name", "category_2"], ["updated_at", "2015-10-27 15:47:04.825573"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "parent_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-27 15:47:04.828312"], ["name", "category_3"], ["parent_id", 1], ["updated_at", "2015-10-27 15:47:04.828312"]]  (0.7ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (4.1ms) Rendered categories/edit.html.erb within layouts/application (4.3ms) Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = 3 [["parent_id", 2], ["updated_at", "2015-10-27 15:47:04.845348"]]  (1.0ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 5ms (ActiveRecord: 1.6ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.7ms) Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.865749"], ["name", "shoes"], ["updated_at", "2015-10-27 15:47:04.865749"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.868562"], ["name", "skirt"], ["updated_at", "2015-10-27 15:47:04.868562"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.870794"], ["name", "pents"], ["updated_at", "2015-10-27 15:47:04.870794"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:04.913028"], ["name", "product"], ["updated_at", "2015-10-27 15:47:04.913028"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:47:04.914681"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:04.914681"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 15:47:04.915666"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:04.915666"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (15.4ms) Rendered products/edit.html.erb within layouts/application (18.0ms) Completed 200 OK in 23ms (Views: 21.0ms | ActiveRecord: 0.8ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:04 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:47:05 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:47:06 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", "2015-10-27 15:47:07.071844"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:07.071844"]]  (0.9ms) commit transaction Redirected to http://127.0.0.1:50158/products Completed 302 Found in 14ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.1ms) Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:07.137691"], ["name", "shoes"], ["updated_at", "2015-10-27 15:47:07.137691"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:07.140279"], ["name", "skirt"], ["updated_at", "2015-10-27 15:47:07.140279"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:07.142526"], ["name", "pents"], ["updated_at", "2015-10-27 15:47:07.142526"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.5ms) Rendered products/new.html.erb within layouts/application (5.1ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:47:07 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 16:47:08 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.268180"], ["name", "hello"], ["updated_at", "2015-10-27 15:47:09.268180"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:47:09.269416"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.269416"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 15:47:09.270304"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.270304"]]  (2.7ms) commit transaction Redirected to http://127.0.0.1:50158/products Completed 302 Found in 10ms (ActiveRecord: 3.5ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#index as HTML Product Load (0.3ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.5ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.2ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.334864"], ["name", "shoes"], ["updated_at", "2015-10-27 15:47:09.334864"]]  (1.0ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.337964"], ["name", "skirt"], ["updated_at", "2015-10-27 15:47:09.337964"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.340552"], ["name", "pents"], ["updated_at", "2015-10-27 15:47:09.340552"]]  (0.8ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.345574"], ["name", "product"], ["updated_at", "2015-10-27 15:47:09.345574"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:47:09.346864"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.346864"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 15:47:09.348054"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.348054"]]  (0.9ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (6.8ms) Rendered products/edit.html.erb within layouts/application (7.0ms) Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.5ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) Category Load (0.6ms) SELECT "categories".* FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] SQL (0.3ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 2], ["created_at", "2015-10-27 15:47:09.375848"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.375848"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 10ms (ActiveRecord: 2.4ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.8ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.3ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.406186"], ["name", "shoes"], ["updated_at", "2015-10-27 15:47:09.406186"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.409099"], ["name", "skirt"], ["updated_at", "2015-10-27 15:47:09.409099"]]  (1.0ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.411628"], ["name", "pents"], ["updated_at", "2015-10-27 15:47:09.411628"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (4.4ms) Rendered products/new.html.erb within layouts/application (4.6ms) Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-27 15:47:09.431939"], ["name", "hello"], ["updated_at", "2015-10-27 15:47:09.431939"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["created_at", "2015-10-27 15:47:09.433397"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.433397"]] SQL (0.3ms) INSERT INTO "product_has_categories" ("category_id", "created_at", "product_id", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["created_at", "2015-10-27 15:47:09.434303"], ["product_id", 1], ["updated_at", "2015-10-27 15:47:09.434303"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 8ms (ActiveRecord: 2.1ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:09 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.9ms) Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.8ms) DELETE FROM "categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.5ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 15:47:13.262544"], ["updated_at", "2015-10-27 15:47:13.262544"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "category_1"], ["created_at", "2015-10-27 15:47:13.268434"], ["updated_at", "2015-10-27 15:47:13.268434"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_2"], ["parent_id", 1], ["created_at", "2015-10-27 15:47:13.270690"], ["updated_at", "2015-10-27 15:47:13.270690"]]  (0.7ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:47:13 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (113.8ms) Rendered categories/edit.html.erb within layouts/application (119.2ms) Completed 200 OK in 292ms (Views: 286.3ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 16:47:13 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_2", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 15:47:13.605039"], ["id", 3]]  (0.8ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (14.0ms) Completed 200 OK in 17ms (Views: 16.3ms | ActiveRecord: 0.2ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 15:47:13.639829"], ["updated_at", "2015-10-27 15:47:13.639829"]]  (0.9ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:47:13 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Rendered categories/new.html.erb within layouts/application (4.8ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:47:13 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 15:47:13.663247"], ["updated_at", "2015-10-27 15:47:13.663247"]]  (0.7ms) commit transaction Redirected to http://www.example.com/categories Completed 302 Found in 3ms (ActiveRecord: 1.1ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:13 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.2ms) Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 15:47:13.685167"], ["updated_at", "2015-10-27 15:47:13.685167"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "new parent"], ["created_at", "2015-10-27 15:47:13.688181"], ["updated_at", "2015-10-27 15:47:13.688181"]]  (0.5ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "category_3"], ["parent_id", 1], ["created_at", "2015-10-27 15:47:13.691021"], ["updated_at", "2015-10-27 15:47:13.691021"]]  (0.7ms) commit transaction Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/categories/3/edit" for 127.0.0.1 at 2015-10-27 16:47:15 +0100 Processing by CategoriesController#edit as HTML Parameters: {"id"=>"3"} Category Load (0.4ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered categories/_form.html.erb (7.1ms) Rendered categories/edit.html.erb within layouts/application (7.7ms) Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.6ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:15 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:15 +0100 Started GET "/categories/token?q=new+parent" for 127.0.0.1 at 2015-10-27 16:47:15 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"new parent"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%new parent%') Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/categories/3" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Processing by CategoriesController#update as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"category_3", "parent_id"=>"2"}, "commit"=>"Update Category", "id"=>"3"} Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "categories" SET "parent_id" = ?, "updated_at" = ? WHERE "categories"."id" = ? [["parent_id", 2], ["updated_at", "2015-10-27 15:47:16.179179"], ["id", 3]]  (2.9ms) commit transaction Redirected to http://127.0.0.1:50167/categories Completed 302 Found in 8ms (ActiveRecord: 3.5ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Processing by CategoriesController#index as HTML Category Load (0.5ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.5ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 3]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.5ms) DELETE FROM "products";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.6ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "wood"], ["created_at", "2015-10-27 15:47:16.248756"], ["updated_at", "2015-10-27 15:47:16.248756"]]  (0.8ms) commit transaction Started GET "/categories/new" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Processing by CategoriesController#new as HTML Rendered categories/_form.html.erb (3.9ms) Rendered categories/new.html.erb within layouts/application (4.1ms) Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Started GET "/categories/token?q=wood" for 127.0.0.1 at 2015-10-27 16:47:16 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"wood"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%wood%') Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.3ms) Started POST "/categories" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Processing by CategoriesController#create as HTML Parameters: {"utf8"=>"✓", "category"=>{"name"=>"hello", "parent_id"=>"1"}, "commit"=>"Create Category"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "parent_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["parent_id", 1], ["created_at", "2015-10-27 15:47:17.349618"], ["updated_at", "2015-10-27 15:47:17.349618"]]  (3.4ms) commit transaction Redirected to http://127.0.0.1:50167/categories Completed 302 Found in 6ms (ActiveRecord: 3.8ms) Started GET "/categories" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Processing by CategoriesController#index as HTML Category Load (0.2ms) SELECT "categories".* FROM "categories" Rendered categories/index.html.erb within layouts/application (1.2ms) Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.2ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) DELETE FROM "categories";  (0.3ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:17.422244"], ["updated_at", "2015-10-27 15:47:17.422244"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:17.425030"], ["updated_at", "2015-10-27 15:47:17.425030"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:17.427570"], ["updated_at", "2015-10-27 15:47:17.427570"]]  (0.7ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (27.0ms) Rendered items/new.html.erb within layouts/application (28.8ms) Completed 200 OK in 50ms (Views: 33.2ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:47:17 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 15:47:18.570957"], ["updated_at", "2015-10-27 15:47:18.570957"]]  (3.3ms) commit transaction Redirected to http://127.0.0.1:50167/items Completed 302 Found in 6ms (ActiveRecord: 3.8ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (2.2ms) Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.9ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:18.634811"], ["updated_at", "2015-10-27 15:47:18.634811"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:18.637671"], ["updated_at", "2015-10-27 15:47:18.637671"]]  (0.6ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:18.640117"], ["updated_at", "2015-10-27 15:47:18.640117"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 15:47:18.643033"], ["updated_at", "2015-10-27 15:47:18.643033"]]  (0.8ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (5.8ms) Rendered items/edit.html.erb within layouts/application (6.5ms) Completed 200 OK in 10ms (Views: 8.8ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:18 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.3ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 15:47:19.742727"], ["id", 1]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:50167/items Completed 302 Found in 7ms (ActiveRecord: 3.7ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.2ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (1.0ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:19.804371"], ["updated_at", "2015-10-27 15:47:19.804371"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:19.807484"], ["updated_at", "2015-10-27 15:47:19.807484"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:19.810601"], ["updated_at", "2015-10-27 15:47:19.810601"]]  (0.9ms) commit transaction Started GET "/items/new" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#new as HTML Rendered items/_form.html.erb (5.9ms) Rendered items/new.html.erb within layouts/application (6.2ms) Completed 200 OK in 9ms (Views: 8.6ms | ActiveRecord: 0.0ms) Started POST "/items" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#create as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"hello", "category_id"=>"1"}, "commit"=>"Create Item"}  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "hello"], ["category_id", 1], ["created_at", "2015-10-27 15:47:19.836476"], ["updated_at", "2015-10-27 15:47:19.836476"]]  (0.8ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 4ms (ActiveRecord: 1.3ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#index as HTML Item Load (0.2ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.2ms) Item Load (0.2ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC LIMIT 1 Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.6ms) DELETE FROM sqlite_sequence where name = 'products';  (0.9ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:19.865907"], ["updated_at", "2015-10-27 15:47:19.865907"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:19.869688"], ["updated_at", "2015-10-27 15:47:19.869688"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.7ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:19.873319"], ["updated_at", "2015-10-27 15:47:19.873319"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "items" ("name", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "item"], ["category_id", 1], ["created_at", "2015-10-27 15:47:19.877019"], ["updated_at", "2015-10-27 15:47:19.877019"]]  (0.9ms) commit transaction Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Started GET "/items/1/edit" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#edit as HTML Parameters: {"id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]] Rendered items/_form.html.erb (7.0ms) Rendered items/edit.html.erb within layouts/application (7.8ms) Completed 200 OK in 10ms (Views: 9.3ms | ActiveRecord: 0.2ms) Started PATCH "/items/1" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#update as HTML Parameters: {"utf8"=>"✓", "item"=>{"name"=>"item", "category_id"=>"2"}, "commit"=>"Update Item", "id"=>"1"} Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction SQL (0.4ms) UPDATE "items" SET "category_id" = ?, "updated_at" = ? WHERE "items"."id" = ? [["category_id", 2], ["updated_at", "2015-10-27 15:47:19.903048"], ["id", 1]]  (0.9ms) commit transaction Redirected to http://www.example.com/items Completed 302 Found in 5ms (ActiveRecord: 1.5ms) Started GET "/items" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ItemsController#index as HTML Item Load (0.6ms) SELECT "items".* FROM "items" Rendered items/index.html.erb within layouts/application (1.4ms) Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.6ms) Item Load (0.1ms) SELECT "items".* FROM "items" WHERE "items"."id" = ? LIMIT 1 [["id", 1]] Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'items';  (0.6ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:19.922957"], ["updated_at", "2015-10-27 15:47:19.922957"]]  (0.7ms) commit transaction  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:19.926404"], ["updated_at", "2015-10-27 15:47:19.926404"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:19.929566"], ["updated_at", "2015-10-27 15:47:19.929566"]]  (0.8ms) commit transaction Category Load (0.9ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 15:47:19.981329"], ["updated_at", "2015-10-27 15:47:19.981329"]] SQL (0.4ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 15:47:19.984209"], ["updated_at", "2015-10-27 15:47:19.984209"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 15:47:19.985749"], ["updated_at", "2015-10-27 15:47:19.985749"]]  (1.0ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:47:19 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (0.2ms) SELECT COUNT(*) FROM "categories" INNER JOIN "product_has_categories" ON "categories"."id" = "product_has_categories"."category_id" WHERE "product_has_categories"."product_id" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (17.0ms) Rendered products/edit.html.erb within layouts/application (19.1ms) Completed 200 OK in 24ms (Views: 22.3ms | ActiveRecord: 0.7ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2, 1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.4ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.2ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 15:47:20.032708"], ["updated_at", "2015-10-27 15:47:20.032708"]]  (1.0ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 2.0ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (3.2ms) Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.3ms) Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (1.5ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (1.0ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:20.059290"], ["updated_at", "2015-10-27 15:47:20.059290"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:20.063633"], ["updated_at", "2015-10-27 15:47:20.063633"]]  (1.0ms) commit transaction  (0.5ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:20.067880"], ["updated_at", "2015-10-27 15:47:20.067880"]]  (0.8ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (11.1ms) Rendered products/new.html.erb within layouts/application (12.0ms) Completed 200 OK in 14ms (Views: 14.0ms | ActiveRecord: 0.1ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"3, 1"}, "commit"=>"Create Product"} Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (3, 1)  (0.1ms) begin transaction SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 15:47:20.097780"], ["updated_at", "2015-10-27 15:47:20.097780"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 15:47:20.099161"], ["updated_at", "2015-10-27 15:47:20.099161"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 15:47:20.100287"], ["updated_at", "2015-10-27 15:47:20.100287"]]  (0.9ms) commit transaction Redirected to http://www.example.com/products Completed 302 Found in 9ms (ActiveRecord: 1.7ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.1ms) Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.3ms) Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (1.1ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.7ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:20.120493"], ["updated_at", "2015-10-27 15:47:20.120493"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:20.123219"], ["updated_at", "2015-10-27 15:47:20.123219"]]  (0.7ms) commit transaction  (0.0ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:20.125601"], ["updated_at", "2015-10-27 15:47:20.125601"]]  (0.7ms) commit transaction Started GET "/products/new" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by ProductsController#new as HTML Rendered products/_form.html.erb (3.3ms) Rendered products/new.html.erb within layouts/application (3.5ms) Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:47:20 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=pents" for 127.0.0.1 at 2015-10-27 16:47:21 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"pents"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%pents%') Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.2ms) Started POST "/products" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"hello", "category_ids"=>"1,3"}, "commit"=>"Create Product"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "hello"], ["created_at", "2015-10-27 15:47:22.235438"], ["updated_at", "2015-10-27 15:47:22.235438"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 15:47:22.236946"], ["updated_at", "2015-10-27 15:47:22.236946"]] SQL (0.0ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 15:47:22.238046"], ["updated_at", "2015-10-27 15:47:22.238046"]]  (0.8ms) commit transaction Redirected to http://127.0.0.1:50167/products Completed 302 Found in 9ms (ActiveRecord: 1.6ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (2.0ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.7ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.7ms) DELETE FROM sqlite_sequence where name = 'products';  (0.8ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.9ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "shoes"], ["created_at", "2015-10-27 15:47:22.297667"], ["updated_at", "2015-10-27 15:47:22.297667"]]  (0.8ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "skirt"], ["created_at", "2015-10-27 15:47:22.300455"], ["updated_at", "2015-10-27 15:47:22.300455"]]  (0.9ms) commit transaction  (0.1ms) begin transaction SQL (0.2ms) INSERT INTO "categories" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "pents"], ["created_at", "2015-10-27 15:47:22.303165"], ["updated_at", "2015-10-27 15:47:22.303165"]]  (0.6ms) commit transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (1, 3)  (0.1ms) begin transaction SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "product"], ["created_at", "2015-10-27 15:47:22.308086"], ["updated_at", "2015-10-27 15:47:22.308086"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 1], ["product_id", 1], ["created_at", "2015-10-27 15:47:22.309436"], ["updated_at", "2015-10-27 15:47:22.309436"]] SQL (0.1ms) INSERT INTO "product_has_categories" ("category_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["category_id", 3], ["product_id", 1], ["created_at", "2015-10-27 15:47:22.310454"], ["updated_at", "2015-10-27 15:47:22.310454"]]  (0.8ms) commit transaction Started GET "/products/1/edit" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Processing by ProductsController#edit as HTML Parameters: {"id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (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" = ? [["product_id", 1]]  (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" = ? [["product_id", 1]] 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" = ? [["product_id", 1]] Rendered products/_form.html.erb (5.1ms) Rendered products/edit.html.erb within layouts/application (5.3ms) Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.4ms) Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Started GET "/categories/token?q=skirt" for 127.0.0.1 at 2015-10-27 16:47:22 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"skirt"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%skirt%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started GET "/categories/token?q=shoes" for 127.0.0.1 at 2015-10-27 16:47:23 +0100 Processing by CategoriesController#token as JSON Parameters: {"q"=>"shoes"} Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE (categories.name like '%shoes%') Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms) Started PATCH "/products/1" for 127.0.0.1 at 2015-10-27 16:47:24 +0100 Processing by ProductsController#update as HTML Parameters: {"utf8"=>"✓", "product"=>{"name"=>"product", "category_ids"=>"2,1"}, "commit"=>"Update Product", "id"=>"1"} Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) begin transaction Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" IN (2, 1) 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" = ? [["product_id", 1]] SQL (0.2ms) DELETE FROM "product_has_categories" WHERE "product_has_categories"."product_id" = ? AND "product_has_categories"."category_id" = 3 [["product_id", 1]] SQL (0.3ms) INSERT INTO "product_has_categories" ("product_id", "category_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["product_id", 1], ["category_id", 2], ["created_at", "2015-10-27 15:47:24.422229"], ["updated_at", "2015-10-27 15:47:24.422229"]]  (3.2ms) commit transaction Redirected to http://127.0.0.1:50167/products Completed 302 Found in 10ms (ActiveRecord: 4.2ms) Started GET "/products" for 127.0.0.1 at 2015-10-27 16:47:24 +0100 Processing by ProductsController#index as HTML Product Load (0.2ms) SELECT "products".* FROM "products"  (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" = ? [["product_id", 1]] Rendered products/index.html.erb within layouts/application (1.9ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.3ms) Started GET "/assets/application.js" for 127.0.0.1 at 2015-10-27 16:47:24 +0100 Started GET "/assets/application.css" for 127.0.0.1 at 2015-10-27 16:47:24 +0100 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 1]] 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" = ? [["product_id", 1]]  (0.9ms) DELETE FROM "categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'categories';  (0.8ms) DELETE FROM "products";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.8ms) DELETE FROM sqlite_sequence where name = 'products';  (0.7ms) DELETE FROM "product_has_categories";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.9ms) DELETE FROM sqlite_sequence where name = 'product_has_categories';  (0.8ms) DELETE FROM "items";  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';  (0.1ms) DELETE FROM sqlite_sequence where name = 'items';